summaryrefslogtreecommitdiffstats
path: root/lib/libc/string
Commit message (Collapse)AuthorAgeFilesLines
* Document bitset(9)cem2015-10-171-2/+3
|
* Add declaration to eliminate -Wmissing-prototypes warning.rodrigc2015-09-201-0/+2
|
* Replace strndup with OpenBSD's implementation.delphij2015-08-261-33/+22
| | | | MFC after: 2 weeks
* Fix spelling.araujo2015-08-241-2/+1
| | | | | | Reviewed by: wblock, pfg Approved by: bapt (mentor) Differential Revision: D3380
* Update bzero(3) manpage to following the Posix Standard.araujo2015-08-241-1/+9
| | | | | | Reviewed by: wblock, pfg Approved by: bapt (mentor) Differential Revision: D3380
* Make clear the bcopy(3) manpage regards when it was marked as LEGACYaraujo2015-08-141-13/+23
| | | | | | | | as well as when it was removed from POSIX specification. Reviewed by: theraven, wblock, bapt, rodrigc Approved by: bapt, rodrigc (mentor) Differential Revision: D3374
* Remove the mention of memcpy(3) that is build on top of bcopy(3).araujo2015-08-131-9/+7
| | | | | | | | | | Fix some phrases to make it more clear. Differential Revision: D3378 Reported by: bde@ Reviewed by: wblock Approved by: bapt, rodrigc (mentor) Sponsored by: gandi.net
* Describe that bcopy(3) is deprecated and marked as LEGACY inaraujo2015-08-121-1/+15
| | | | | | | | | | POSIX.1-2001 and removed from the specification in POSIX.1-2008. New softwares shall use memcpy(3) or memmove(3). Differential Revision: D3358 Reviewed by: wblock Approved by: rodrigc Sponsored by: gandi.net
* strchr(3): Mdoc fixes.jilles2015-06-041-3/+5
|
* memmem(3): empty little string matches the beginning of the big stringemaste2015-05-262-11/+17
| | | | | | | | | | | | This function originated in glibc, and this matches their behaviour (and NetBSD, OpenBSD, and musl). An empty big string (arg "l") is handled by the existing l_len < s_len test. Reviewed by: bapt, ngie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2657
* Make strlcpy/strlcat slightly easier to read.pfg2015-04-062-43/+42
| | | | | | Bring small upstream updates. Obtained from: OpenBSD
* Various mdoc fixes and a few EOL whitespace removals.brueffer2014-12-211-1/+1
| | | | Found with: mandoc -Tlint
* Remove duplicated code.delphij2014-10-162-22/+1
| | | | Suggested by: jmg
* Add MLINK for explicit_bzero(3) and bump .Dd date.delphij2014-10-072-1/+2
| | | | MFC after: 2 weeks
* Add explicit_bzero(3) and its kernel counterpart.delphij2014-10-074-2/+45
| | | | | Obtained from: OpenBSD MFC after: 2 weeks
* use .Mt to mark up email addresses consistently (part4)bapt2014-06-233-5/+4
| | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de>
* Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance.pfg2014-05-301-2/+2
| | | | | | | | | | | | POSIX.1-2008 specifies that those two functions should be declared by including <strings.h>, not <string.h> (the latter only has strcoll_l() and strxfrm_l()): http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html Obtained from: DragonFlyBSD Reviewed by: theraven MFC after: 2 weeks
* Emphasis on 'do not' and 'complement' in the strcspn(3)allanjude2014-05-271-5/+6
| | | | | | Replace literal parentheses with .Po/.Pc Approved by: wblock (mentor)
* Merge strcspn.3 into strspn.3 and clarify the explaination of what they doallanjude2014-05-253-98/+37
| | | | | | | Detach strcspn.3 from the build Add strcspn.3 to MLINKS do it will be symlinked to strspn.3 Approved by: eadler (mentor), bcr (mentor)
* libc man pages: Remove reference to non-existent FreeBSD Securityeadler2014-03-072-6/+0
| | | | | | Architecture MFC After: 3 days
* Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}marcel2014-03-041-4/+4
| | | | | | | | | | | if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc.
* Fix typo: site_t -> size_teadler2013-11-101-1/+1
| | | | Obtained From: DragonflyBSD (1ac92c8c857a15dc010924c5f066da404e568640)
* Fix .Dd after r257646.gjb2013-11-051-1/+1
| | | | | DST affects the day by one hour, but the number of days in the week stay the same.
* Use OpenBSD's revamped description of strlcpy and strlcat.eadler2013-11-041-68/+63
| | | | | | | | | | | This explanation is supposed to be simpler and better. In particular "comparing it to the snprintf API provides lots of value, since it raises the bar on understanding, so that programmers/auditors will a better job calling all 3 of these functions." Requested by: deraadt@cvs.openbsd.org Obtained From: OpenBSD Reviewed by: cperciva
* libc: Always use our own copy of sys_errlist and sys_nerr (.so only).jilles2013-08-311-3/+5
| | | | | | | | | | | | | | | This ensures strerror() and friends continue to work correctly even if a (non-PIE) executable linked against an older libc imports sys_errlist (which causes sys_errlist to refer to the executable's copy with a size fixed when that executable was linked). The executable's use of sys_errlist remains broken because it uses the current value of sys_nerr and may access past the bounds of the array. Different from the message "Using sys_errlist from executables is not ABI-stable" on freebsd-arch, this change does not affect the static library. There seems no reason to prevent overriding the error messages in the static library.
* Renumber clauses to reduce diffs to other versionsemaste2013-05-2873-73/+73
| | | | | NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3, so follow suit to make comparison easier.
* Create a symlink from strchrnul.3 to strchr.3.zeising2013-03-061-1/+2
| | | | | | This was forgotten in the initial commit of strchrnul() Approved by: theraven
* Add strchrnul(), a GNU function similar to strchr(), except that it returnszeising2013-02-134-5/+81
| | | | | | | a pointer to the end of the string, rather than NULL, if the character was not found. Approved by: theraven
* clarify the wording for 'first' and 'last'eadler2012-09-301-5/+4
| | | | | Approved by: wblock MFC after: 3 days
* strsignal(): Reindent.jilles2012-09-191-21/+21
|
* strsignal(): Do not append signal numbers to messages for known signals.jilles2012-09-191-1/+1
| | | | | Messages for known signals looked like "Terminated: 15" instead of "Terminated".
* Correct BUGS description of static buffer useemaste2012-07-271-3/+3
| | | | | | | Since r142667 strerror has unconditionally returned a pointer to a static buffer. MFC after: 1 week
* Add the functions documented in the man pages in commit 237393 to theissyl02012-06-211-2/+7
| | | | | | | | relevant Makefile. Reminded by: gavin Approved by: gabor (mentor) MFC after: 5 days
* Add more locale-specific functions to the relevant man pages:issyl02012-06-214-7/+54
| | | | | | | | | | | - libc/string/strcoll.3 - libc/string/strstr.3 - libc/string/strxfrm.3 - libc/string/strcasecmp.3 Reviewed by: theraven, gabor Approved by: gabor (mentor) MFC after: 5 days
* General mdoc(7) and typo fixes.gjb2012-05-111-1/+1
| | | | | | PR: 167734 Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org) MFC after: 3 days
* Remove trailing whitespace per mdoc lint warningeadler2012-03-291-1/+1
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* Fix indentation.kib2012-03-141-1/+1
| | | | MFC after: 3 days
* POSIX mandates that swab do nothing when len < 0eadler2012-03-042-1/+6
| | | | | | | PR: kern/140690 Submitted by: Jeremy Huddleston <jeremyhu@apple.com> Approved by: cperciva MFC after: 2 weeks
* Add err(3) to strerror(3) SEE ALSO sectioneadler2012-02-161-0/+1
| | | | | | | PR: docs/164940 Submitted by: Niclas Zeising <zeising@daemonic.se> Approved by: cperciva MFC after: 3 days
* Change index() and rindex() to a weak alias.ed2012-01-052-2/+2
| | | | | | | | This allows people to still write statically linked applications that call strchr() or strrchr() and have a local variable or function called index. Discussed with: bde@
* Merge index() and strchr() together.ed2012-01-035-129/+105
| | | | | | | | | | | | | | | | | As I looked through the C library, I noticed the FreeBSD MIPS port has a hand-written version of index(). This is nice, if it weren't for the fact that most applications call strchr() instead. Also, on the other architectures index() and strchr() are identical, meaning we have two identical pieces of code in the C library and statically linked applications. Solve this by naming the actual file strchr.[cS] and let it use __strong_reference()/STRONG_ALIAS() to provide the index() routine. Do the same for rindex()/strrchr(). This seems to make the C libraries and static binaries slightly smaller, but this reduction in size seems negligible.
* Revert r227812 and r227808 per discussioneadler2011-12-024-30/+18
| | | | | Reviewed by: many Approved by: des
* - fix some style(9) nits with my last commiteadler2011-11-222-3/+5
| | | | | | | - add a comment explaining why I used '|' instead of '||' Submitted by: danfe@ Approved by: emaste@
* - add check for pointer equality prior to performing the O(n) passeadler2011-11-224-18/+28
| | | | | | | | | - while here change 's' to 's1' in strcoll Submitted by: eadler@ Reviewed by: theraven@ Approved by: brooks@ MFC after: 2 weeks
* (Hopefully) Fix the build with clang by removing a typedef that's no longer ↵theraven2011-11-211-2/+0
| | | | | | needed. Approved by: brooks (mentor)
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds atheraven2011-11-208-29/+140
| | | | | | | | | | | | load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation. Please test any code you have that uses the C standard locale functions! Reviewed by: das (gdtoa changes) Approved by: dim (mentor)
* Fix prototype for ffsll(3) and fls(3).delphij2011-05-031-2/+2
| | | | | | PR: docs/156796 Submitted by: Jean-Yves Migeon <jeanyves.migeon free.fr> MFC after: 3 days
* Allow strerror(0) and strerror_r(0, ...).jilles2011-04-052-2/+5
| | | | | | | | | | | | | Of course, strerror_r() may still fail with ERANGE. Although the POSIX specification said this could fail with EINVAL and doing this likely indicates invalid use of errno, most other implementations permitted it, various POSIX testsuites require it to work (matching the older sys_errlist array) and apparently some applications depend on it. PR: standards/151316 MFC after: 1 week
* index(3): Mention that index/rindex are deprecated and not specified byjilles2011-03-201-1/+14
| | | | | | POSIX.1-2008. MFC after: 1 week
* Powerpc is special here. powerpc and powerpc64 use different ABIs, soimp2010-08-241-4/+2
| | | | | | their implementations aren't in the same files. Introduce LIBC_ARCH and use that in preference to MACHINE_CPUARCH. Tested by amd64 and powerpc64 builds (thanks nathanw@)
OpenPOWER on IntegriCloud