summaryrefslogtreecommitdiffstats
path: root/lib/libc/string
Commit message (Collapse)AuthorAgeFilesLines
* 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@)
* MFtbemd:imp2010-08-231-3/+3
| | | | | Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform.
* mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to theuqs2010-05-132-27/+27
| | | | | | | | | | | bottom of the manpages and order them consistently. GNU groff doesn't care about the ordering, and doesn't even mention CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put them. Found by: mdocml lint run Reviewed by: ru
* Correct bugs fixed but not merged from my own tree.delphij2010-03-131-2/+3
| | | | | Pointy hat to: delphij MFC after: 1 month
* Follow up commit to reindent the code.delphij2010-03-121-13/+13
| | | | MFC after: 1 month
* Two optimizations to MI strlen(3) inspired by David S. Miller'sdelphij2010-03-121-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blog posting [1]. - Use word-sized test for unaligned pointer before working the hard way. Memory page boundary is always integral multiple of a word alignment boundary. Therefore, if we can access memory referenced by pointer p, then (p & ~word mask) must be also accessible. - Better utilization of multi-issue processor's ability of concurrency. The previous implementation utilized a formular that must be executed sequentially. However, the ~, & and - operations can actually be caculated at the same time when the operand were different and unrelated. The original Hacker's Delight formular also offered consistent performance regardless whether the input would contain characters with their highest-bit set, as it catches real nul characters only. These two optimizations has shown further improvements over the previous implementation on microbenchmarks on i386 and amd64 CPU including Pentium 4, Core Duo 2 and i7. [1] http://vger.kernel.org/~davem/cgi-bin/blog.cgi/2010/03/08#strlen_1 MFC after: 1 month
* Mark up "unsigned char".ru2010-02-044-4/+11
|
* Implement strndup(3) using strnlen(3).ed2010-02-021-3/+1
| | | | | This makes the implementation a bit more consistent with strdup(3), which uses strlen(3).
* Make strsignal(3) thread-safe.ume2010-01-241-4/+48
| | | | MFC after: 2 weeks
* Add a missing word to a sentence in the return values section.trhodes2009-12-041-1/+1
|
* Add an .Nm for strncat.brueffer2009-12-011-2/+3
| | | | | | PR: 141037 Submitted by: Jeremy Huddleston <jeremyhu@apple.com> MFC after: 3 days
* Correct the information about when the respective functionality firstbrueffer2009-04-231-1/+1
| | | | | | | | appeared in FreeBSD. PR: 133785 Submitted by: Ulrich Spoerlein <uqs@spoerlein.net> MFC after: 3 days
* There is no way for strmode(3) to append '+' if the file has ACL,trasz2009-04-142-4/+2
| | | | | because there is no way to figure that out based on the file mode itself. Make the manual page match reality.
* Add wide character variants of string manipulations routines to 'SEE ALSO'.trasz2009-04-0716-16/+33
| | | | Approved by: rwatson (mentor)
* 7.2 will be the first release where strndup() appears.kib2009-03-221-1/+1
| | | | | Submitted by: Florian Smeets <flo kasimir com> MFC after: 3 days
* Add wcpcpy(3) and wcpncpy(3).das2009-03-045-3/+108
|
* Add restrict qualifiers.das2009-02-281-1/+1
| | | | I missed this file in my previous commit.
* - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),das2009-02-2810-21/+312
| | | | | | | | | | | | wcscasecmp(), and wcsncasecmp(). - Make some previously non-standard extensions visible if POSIX_VISIBLE >= 200809. - Use restrict qualifiers in stpcpy(). - Declare off_t and size_t in stdio.h. - Bump __FreeBSD_version in case the new symbols (particularly getline()) cause issues with ports. Reviewed by: standards@
* Add restrict qualifiers to the parameters to strlcpy() and strlcat().das2009-02-283-4/+4
| | | | | The annotation mainly just serves as a hint that they're not intended for use with overlapping strings.
* Make sure the comparison is done with an unsigned char.imp2009-02-071-1/+1
|
* Fix the functions to match prototypes. The K&R definitions differimp2009-02-033-3/+3
| | | | from the ANSI-C prototype due to the 'int promotion' rule.
* - ANSIfy function definitionsdanger2009-02-0333-110/+41
| | | | | | - use nul when we are looking for a terminating character where appropriate Approved by: imp
* - Fix grammar. [1]delphij2009-01-261-3/+3
| | | | | | | | - Use the correct term 'long mode'. [2] - style(9) for return value. [3] Submitted by: Ben Kaduk <minimarmot gmail com> [1], obrien [2], scf [3]
* Rewrite of MI strlen(3) in a way that can better utilize modern hardware bydelphij2009-01-251-15/+78
| | | | | | | | | reducing branches and doing word-sized operation. The idea is taken from J.T. Conklin's x86_64 optimized version of strlen(3) for NetBSD, and reimplemented in C by me. Discussed on: -arch@
* Document that ffsll(3) and flsll(3) functions first appeared inkib2009-01-131-1/+1
| | | | | | | FreeBSD 7.1 Submitted by: Jan Henrik Sylvester <me janh de> MFC after: 3 days
* o Language improvements from OpenBSD;delphij2009-01-121-17/+17
| | | | | | o Use an ISC-style license as did by the author. Obtained from: OpenBSD
* o ANSIfy.delphij2009-01-121-29/+12
| | | | | | o Use ISC style copyright as did by the author. Obtained from: OpenBSD
* Sort MLINKS.ru2009-01-091-21/+32
|
* o Use full month name in .Dd macro.maxim2008-12-091-1/+1
|
* Import the strndup(3) function.kib2008-12-064-3/+75
| | | | | | | | Copyright attribution is kept the same as in original NetBSD source. Submitted by: Florian Smeets <flo kasimir com> Obtained from: NetBSD MFC after: 2 weeks
* Order the str*.c files mostly alphabetical.kib2008-12-061-3/+3
| | | | | Submitted by: Florian Smeets <flo kasimir com> MFC after: 2 weeks
* Add an easier example.pjd2008-12-051-1/+16
| | | | Reviewed by: trasz
* Add the ffsll and flsll functions. These are ffs and fls operatingkib2008-11-035-8/+122
| | | | | | | | on long long arguments. Reviewed by: bde (previous version, that included asm implementation for all ffs and fls functions on i386 and amd64) MFC after: 2 weeks
* Fix style.kib2008-11-031-1/+1
|
* - License change to a less restrictive one;delphij2008-10-191-33/+16
| | | | | | | | - ANSIfy; - Convert do {} while loop -> while {} for clarity; - Sync RCS ID with OpenBSD; Obtained from: OpenBSD
* Further simplify the code.delphij2008-10-191-11/+2
| | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de>
* Use strlcpy() in !localized case to avoid the -1's.delphij2008-10-171-2/+1
|
* Add memrchr(3).delphij2008-04-104-4/+74
| | | | Obtained from: OpenBSD
* Remove license clause 3 to agree with the now-standard BSD license.wes2007-12-123-14/+0
| | | | Prompted by: Glenn Halperin, Symbian Software
* Use C comments since we now preprocess these files with CPP.deischen2007-04-291-2/+4
|
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-0968-272/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Don't say "rightmost" when referring to the least significant bit.ru2006-10-121-4/+5
| | | | | PR: docs/94803 MFC after: 3 days
* Improve the wording. Remove the appositive about strcmp, putting thedd2006-08-141-2/+5
| | | | | first sentence back to the way it was. Add a second sentence that explains the case when strcmp is called.
* o Make grep ^strlcpy work: put a return value type on separate line.maxim2006-06-151-1/+2
|
* Add each directory's symbol map file to SYM_MAPS.deischen2006-03-131-0/+2
|
* Add symbol maps and initial symbol version definitions to libc.deischen2006-03-131-0/+80
| | | | Reviewed by: davidxu
* Fix prototype.ru2005-11-241-2/+2
|
OpenPOWER on IntegriCloud