summaryrefslogtreecommitdiff
path: root/include/strings.h
AgeCommit message (Collapse)Author
2024-07-13include: ssp: round out fortification of current set of headersKyle Evans
ssp/ssp.h needed some improvements: - `len` isn't always a size_t, it may need casted - In some cases we may want to use a len that isn't specified as a parameter (e.g., L_ctermid), so __ssp_redirect() should be more flexible. - In other cases we may want additional checking, so pull all of the declaration bits out of __ssp_redirect_raw() so that some functions can implement the body themselves. strlcat/strlcpy should be the last of the fortified functions that get their own __*_chk symbols, and these cases are only done to be consistent with the rest of the str*() set. Reviewed by: markj Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45679
2024-05-14ssp: appease -Wgnu-statement-expression-from-macro-expansionKyle Evans
It's a stupid warning, but some ports enable it by default and were already defining _FORTIFY_SOURCE, thus exposing the new macros immediately. This at least fixes the libfido2 build, perhaps others as well. While we're here, fix a fresh build of stand w/ FORTIFY_SOURCE enabled by not pulling in the ssp headers if _STANDALONE is defined. We do not have runtime support in libsa as of the time of writing. Reported by: netchild Sponsored by: Stormshield Sponsored by: Klara, Inc.
2024-05-13Add a build knob for _FORTIFY_SOURCEKyle Evans
In the future, we will Default to _FORTIFY_SOURCE=2 if SSP is enabled, otherwise default to _FORTIFY_SOURCE=0. For now we default it to 0 unconditionally to ease bisect across older versions without the new symbols, and we'll put out a call for testing. include/*.h include their ssp/*.h equivalents as needed based on the knob. Programs and users are allowed to override FORTIFY_SOURCE in their Makefiles or src.conf/make.conf to force it off. Reviewed by: des, markj Relnotes: yes Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32308
2023-08-16Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
2017-11-25include: General further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326192
2014-10-07Add explicit_bzero(3) and its kernel counterpart.Xin LI
Obtained from: OpenBSD MFC after: 2 weeks Notes: svn path=/head/; revision=272673
2014-05-30Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance.Pedro F. Giffuni
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 Notes: svn path=/head/; revision=266865
2010-01-04This should read #if __BSD_VISIBLE instead of #ifdef __BSD_VISIBLE.Ed Schouten
Notes: svn path=/head/; revision=201525
2009-03-04- Remove bcmp, bcopy, bzero, index, and rindex from the POSIX.1-2008David Schultz
namespace. - Add ffs to the XSI namespace. Notes: svn path=/head/; revision=189350
2008-11-03Add the ffsll and flsll functions. These are ffs and fls operatingKonstantin Belousov
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 Notes: svn path=/head/; revision=184587
2004-07-23Add __pure and __pure2 where appropriate.Tim J. Robbins
Notes: svn path=/head/; revision=132577
2004-07-09Reduce namespace pollution.Dag-Erling Smørgrav
Notes: svn path=/head/; revision=131875
2004-01-13Add and document ffsl(), fls() and flsl().Dag-Erling Smørgrav
Notes: svn path=/head/; revision=124483
2002-08-21o Merge <machine/ansi.h> and <machine/types.h> into a new headerMike Barcroft
called <machine/_types.h>. o <machine/ansi.h> will continue to live so it can define MD clock macros, which are only MD because of gratuitous differences between architectures. o Change all headers to make use of this. This mainly involves changing: #ifdef _BSD_FOO_T_ typedef _BSD_FOO_T_ foo_t; #undef _BSD_FOO_T_ #endif to: #ifndef _FOO_T_DECLARED typedef __foo_t foo_t; #define _FOO_T_DECLARED #endif Concept by: bde Reviewed by: jake, obrien Notes: svn path=/head/; revision=102227
2002-04-04o Move some function prototypes from <string.h> to the newly rewrittenMike Barcroft
<strings.h>, based on POSIX.1-2001's requirements. o Add 'restrict' qualifier (spelled '__restrict') to functions in <string.h>, as per C99 and POSIX.1-2001. o Properly expose new POSIX.1-2001 functions in <string.h>. Notes: svn path=/head/; revision=93747
1994-05-24BSD 4.4 Lite Include SourcesRodney W. Grimes
Notes: svn path=/head/; revision=1539