Module Name: src Committed By: riastradh Date: Fri Nov 1 21:11:37 UTC 2024
Modified Files: src/common/lib/libc/string: strlcat.c strlcpy.c src/include: string.h src/sys/lib/libkern: libkern.h Log Message: string.h: Fix various symbol visibility issues. 1. Order declarations according to POSIX 2024 to make this easier to review side-by-side with the spec. 2. Fix visibility of memccpy: XSI-only, not POSIX in general; require _XOPEN_SOURCE, not just _POSIX_C_SOURCE. 3. Omit redundant _XOPEN_SOURCE test around stpcpy/stpncpy. 4. Hide strdup in POSIX 2001. Not POSIX (without XSI) until 2008. 5. Hide strerror_r until POSIX 2001. Can't find evidence of it in any earlier POSIX or X/Open. (Not 100% sure on this one, maybe someone can double-check my research.) 6. Add restrict to strlcat/strlcpy. 7. Omit redundant _XOPEN_SOURCE test around strndup and strnlen. 8. Hide strtok_r until POSIX 2001. Can't find evidence of it in any earlier POSIX or X/Open. (Not 100% sure on this one, maybe someone can double-check my research.) Carry the restrict qualifiers on strlcat/strlcpy to libkern too. Main reference: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/string.h.html PR standards/58804: string.h: wrong visibility for memccpy To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/string/strlcat.c cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/string/strlcpy.c cvs rdiff -u -r1.55 -r1.56 src/include/string.h cvs rdiff -u -r1.146 -r1.147 src/sys/lib/libkern/libkern.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.