summaryrefslogtreecommitdiff
path: root/src/lib/libc/string (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Instead of trying to handle ffs() with the normal rename-mark-hidden-and-aliasguenther2018-01-181-2/+1
| | | | | | | dance, mark it protected. This works better for both gcc and clang: gcc blocks overriding of internal calls, while clang permits inlining again. ok otto@
* clang doesn't propagate attributes like "asm labels" and "visibility(hidden)"guenther2017-11-293-6/+6
| | | | | | | | | to builtins like mem{set,cpy,move} and __stack_smash_handler. So, when building with clang, instead mark those as protected visibility to get rid of the PLT relocations. We can't take the address of them then, but that's ok: it's a build-time error not a run-time error. ok kettenis@
* GNU ld has prefixed the contents of .gnu.warning.SYMBOL sectionstb2017-11-285-10/+10
| | | | | | | | with "warning: " since 2003, so the messages themselves need not contain the prefix anymore. From Scott Cheloha ok jca, deraadt
* Add STANDARDS: denis@ spotted that it was missing.schwarze2017-10-121-2/+19
| | | | OK deraadt@ jca@ jmc@
* New POSIX xlocale implementation written from scratch.libressl-v2.6.1schwarze2017-09-0511-96/+396
| | | | | | | | | | | | Complete in the sense that all POSIX *locale(3) and *_l(3) functions are included, but in OpenBSD, we of course only really care about LC_CTYPE and we only support ASCII and UTF-8. With important help from kettenis@, guenther@, and jca@. Repeated testing in ports bulk builds by naddy@. Additional testing by jca@, sebastia@, dcoppa@, and others. OK kettenis@ dcoppa@, and guenther@ on an earlier version. Riding guenther@'s libc/librthread major bump.
* delete pointless .Tn ASCII found by jca@ with mandoc -Tlintschwarze2017-09-021-5/+4
|
* Mention strtok_r in STANDARDSjca2017-08-311-2/+6
| | | | POSIX 2001 instead of POSIX.1c suggested by millert@ and jmc@, ok jmc@
* Use sendsyslog() directly instead of syslog_r() for the "backwards memcpy"guenther2017-08-141-3/+12
| | | | | | | messages, to avoid pulling in piles of other machinery unnecessarily problem observed by schwarze@ ok deraadt@ millert@
* void functions don't return 0tb2017-07-051-6/+2
| | | | From Klemens Nanni
* New strstr() implementation from musl libc by Rich Felker. Thismillert2017-04-121-44/+180
| | | | | | | | version uses the two-way string matching algorithm and is faster than the old implementation. With this change, ports that check for strstr having linear complexity time strstr will no longer replace the libc strstr with a private version. OK deraadt@ espie@
* the referred to EXAMPLES section is now in strncpy(3);jmc2016-11-121-3/+3
| | | | | | issue reported by scott cheloha ok otto
* Remove the save_errno dance inside strerror_r(3). It is from thebluhm2016-10-191-5/+3
| | | | | time when we had national language support. OK millert@
* Roll back uintptr_t cast changes after discussions with tedu, otto anddtucker2016-10-163-24/+7
| | | | | | | | | | | | | others. C11 6.5.6.9 says: When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object; the result is the difference of the subscripts of the two array elements. In these cases the objects are arrays of char so the result is defined, and we believe that the report is based on a compiler incorrectly trapping on defined behaviour.
* Cast pointers to uintptr_t to avoid potential signedness errors.dtucker2016-10-143-7/+24
| | | | | Based on patch from yuanjie.huang at windriver.com via OpenSSH bz#2608, with & ok millert, ok deraadt.
* The destination string is declared as "s" but referred to as "dst"millert2016-05-261-5/+5
| | | | | in some cases. Be consistent and use "dst" everywhere like for strlcat(3) and strncat(3). From Tim Kuijsten.
* Add RETURN VALUES section and .Xr to memmem(3).schwarze2016-05-111-3/+4
| | | | | From Michal Mazurek <akfaew at jasminek dot net>. OK tedu@
* for some time now mandoc has not required MLINKS to functionjmc2016-03-301-21/+1
| | | | | | | | | | | | correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
* Phrase allocation failure more clearly. ok deraadt@mmcc2015-12-011-3/+3
|
* Document that these functions are now in strings.h.daniel2015-11-247-19/+22
| | | | ok millert@
* The only thing that was translated into multiple languages in OpenBSDbluhm2015-10-251-23/+1
| | | | | | | | | are the errno messages and signal names. Everything else is in English. We are not planning to translate more text. Running a mixed system with less than 1% of the text in native language makes no sense. So remove the NLS support from libc messages. The catopen(3) functions stay as they are. OK stsp@ mpi@
* Eliminate the last of the LINTEDn and PRINTFLIKEn comments. In oneguenther2015-10-015-11/+5
| | | | | | | case, by deleting some useless '& of an array' we also eliminate the need for the casts which prompted the original lint warnings ok deraadt@
* __strsignal() is now declared in hidden/signal.hguenther2015-09-121-2/+0
|
* Wrap <inttypes.h> and finish wrapping of <wchar.h> so that calls go directguenther2015-09-1222-22/+47
| | | | and the symbols not in the C standard are weak
* Fix aliasing of sys_errlist, sys_nerr, sys_siglist, and sys_signameguenther2015-09-061-7/+3
| | | | | | to eliminate duplicate copies of the tables and get direct access internally ok kettenis@ deraadt@
* Use new framework for wrapping cat{open,gets,close}(), eliminatingguenther2015-09-051-4/+1
| | | | | | _cat* in the process. ok kettenis@
* Add framework for resolving (pun intended) libc namespace issues, usingguenther2015-08-3142-40/+84
| | | | | | | | | | | | wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
* Remove needless casts. There's no reason to cast delim to char *millert2015-06-191-5/+4
| | | | when we can just make spanp const char * to match it. OK deraadt@
* Make index/rindex weak aliases of strchr/strrchr since they are notmillert2015-05-154-90/+6
| | | | | part of the ISO C standard and have also been dropped from POSIX. OK guenther@ kettenis@
* Update comment to match code; Caspar Schutijserlibressl-v2.1.4millert2015-03-021-2/+2
|
* Make strlcpy/strlcat slightly easier to read.millert2015-01-154-86/+82
|
* catch up with swab.c rev. 1.9:schwarze2014-12-121-5/+23
| | | | update SYNOPSIS and DESCRIPTION and add STANDARDS
* update swab() to match the current posix definition. "rationale: none."tedu2014-12-111-50/+24
| | | | | | rewrite the function to be simpler as well. the compiler can unroll the loop for us if necessary. ok schwarze
* no more string(3);jmc2014-12-091-3/+2
|
* In ingo's new world order, we do not want multiple manual pages describingderaadt2014-12-093-247/+3
| | | | | | | the same thingies. Therefore these "lists of functions" man pages can go away. Hurray! I've wanted these pages to die for around 10 years! ok ingo (and i think jmc)
* Replace all 14 instances of .St -ansiC-99 in our tree with .St -isoC-99.schwarze2014-11-301-3/+3
| | | | | | The former is not used anywhere in NetBSD, FreeBSD, or DragonFly and not supported by groff, so i'm going to delete it from mandoc(1). We don't need two macros for the same thing.
* restructure libc/string + libc/arch/*/string coperation regardingderaadt2014-11-308-155/+309
| | | | | | | | | | | | | | | | (potentially) MD versions (function dependent, not filename dependent) split out memcpy/memmove/bcopy and strchr/index/strrchr/rindex Bring back amd64 .S versions And the final touch: switch all architectures temporarily to MI memcpy.c, which contains syslog + abort for overlapping copies. A nice harsh undefined behaviour. We will clean the entire userland of the remaining issues in this catagory, then switch to the optimised memcpy which skips the memmove check. I tried to cut this change into pieces, but testing each sub-step on every architecture is too time consuming and mindnumbing. ok miod
* Since deraadt@ remembers seeing strdup() on one particular 4.2BSD machine,schwarze2014-10-111-4/+11
| | | | | | | | | | | i looked a bit closer and found instances before Reno, so correct HISTORY. References: http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.1cBSD/usr/src/ucb/dbx/defs.h http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD/usr/src/etc/inetd.c http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Reno/src/lib/libc/string/strdup.c ok deraadt@
* obvious malloc -> reallocarray, for mult int oflowderaadt2014-10-081-2/+2
|
* rephrase the stpcpy() warningnaddy2014-07-091-2/+2
| | | | new wording agreed by at least kettenis@ millert@ otto@
* loosen the spec for timingsafe functions slightly, so as to nottedu2014-06-211-10/+5
| | | | artificially constrain alternative implementations. ok deraadt
* Protect explicit_bzero() from link-time optimizationmatthew2014-06-211-7/+10
| | | | | | | | | | | | | | | | | | | | Modern compiler toolchains are capable of optimizing even across translation unit boundaries, so simply moving the memory clearing into a separate function is not guaranteed to clear memory. To avoid this, we take advantage of ELF weak symbol semantics, and insert a call to an empty, weakly named function. The semantics of calling this function aren't determinable until load time, so the compiler and linker need to keep the memset() call. There are still ways a toolchain might defeat this trick (e.g., optimistically expecting the weak symbol to not be overloaded, and only calling memset() if it is; promoting weak symbols to strong symbols at link-time when emitting a static binary because they won't be interposed; implementing load-time optimizations). But at least for the foreseeable future, these seem unlikely. ok deraadt
* Add timingsafe_memcmp().matthew2014-06-135-33/+152
| | | | ok deraadt, jmc, tedu
* mop up ifndef KERNEL goo; ok miodderaadt2014-06-1012-60/+12
|
* tweak previous;jmc2014-04-191-3/+2
|
* Use somewhat harsher language and better examples; demonstrate thatderaadt2014-04-194-109/+88
| | | | | non-dangerous use functions is difficult. ok guenther
* Add some missing names to the NAME sections.schwarze2014-04-072-6/+8
| | | | | | For inet(3), go the other way, remove some bogus symlinks. Found while testing the new makewhatis(8). ok jmc@
* remove the never used bm string functionstedu2014-03-233-329/+3
|
* in HISTORY, say where this actually came from;schwarze2014-02-231-5/+7
| | | | ok deraadt@ bentley@
* Remove unnecessary stdio.h include.stsp2014-02-051-2/+1
| | | | Patch by Jean-Philippe Ouellet ; ok krw@
* add explicit_bzero to NAME;jmc2014-01-221-2/+3
|