/freebsd/lib/libc/gen/ |
H A D | dirname_compat.c | e2f68161004f312bf10e4b683ac866b45f6e8489 Fri Aug 12 09:03:58 CEST 2016 Ed Schouten <ed@FreeBSD.org> Reimplement dirname(3) to be thread-safe.
Now that we've updated the prototypes of the basename(3) and dirname(3) functions to conform to POSIX, let's go ahead and reimplement dirname(3) in such a way that it's thread-safe, but also guaranteed to succeed. C libraries like glibc, musl and the one that's part of Solaris already follow such an approach.
Move the existing implementation to another source file, freebsd11_dirname.c to keep existing users of the API that pass in a constant string happy, using symbol versioning.
Put a new version of the function in dirname.c, obtained from CloudABI's C library. This version scans through the pathname string from left to right, normalizing it, while discarding the last pathname component.
Reviewed by: emaste, jilles Differential Revision: https://reviews.freebsd.org/D7355
|
H A D | dirname.3 | diff e2f68161004f312bf10e4b683ac866b45f6e8489 Fri Aug 12 09:03:58 CEST 2016 Ed Schouten <ed@FreeBSD.org> Reimplement dirname(3) to be thread-safe.
Now that we've updated the prototypes of the basename(3) and dirname(3) functions to conform to POSIX, let's go ahead and reimplement dirname(3) in such a way that it's thread-safe, but also guaranteed to succeed. C libraries like glibc, musl and the one that's part of Solaris already follow such an approach.
Move the existing implementation to another source file, freebsd11_dirname.c to keep existing users of the API that pass in a constant string happy, using symbol versioning.
Put a new version of the function in dirname.c, obtained from CloudABI's C library. This version scans through the pathname string from left to right, normalizing it, while discarding the last pathname component.
Reviewed by: emaste, jilles Differential Revision: https://reviews.freebsd.org/D7355
|
H A D | dirname.c | diff e2f68161004f312bf10e4b683ac866b45f6e8489 Fri Aug 12 09:03:58 CEST 2016 Ed Schouten <ed@FreeBSD.org> Reimplement dirname(3) to be thread-safe.
Now that we've updated the prototypes of the basename(3) and dirname(3) functions to conform to POSIX, let's go ahead and reimplement dirname(3) in such a way that it's thread-safe, but also guaranteed to succeed. C libraries like glibc, musl and the one that's part of Solaris already follow such an approach.
Move the existing implementation to another source file, freebsd11_dirname.c to keep existing users of the API that pass in a constant string happy, using symbol versioning.
Put a new version of the function in dirname.c, obtained from CloudABI's C library. This version scans through the pathname string from left to right, normalizing it, while discarding the last pathname component.
Reviewed by: emaste, jilles Differential Revision: https://reviews.freebsd.org/D7355
|
H A D | Symbol.map | diff e2f68161004f312bf10e4b683ac866b45f6e8489 Fri Aug 12 09:03:58 CEST 2016 Ed Schouten <ed@FreeBSD.org> Reimplement dirname(3) to be thread-safe.
Now that we've updated the prototypes of the basename(3) and dirname(3) functions to conform to POSIX, let's go ahead and reimplement dirname(3) in such a way that it's thread-safe, but also guaranteed to succeed. C libraries like glibc, musl and the one that's part of Solaris already follow such an approach.
Move the existing implementation to another source file, freebsd11_dirname.c to keep existing users of the API that pass in a constant string happy, using symbol versioning.
Put a new version of the function in dirname.c, obtained from CloudABI's C library. This version scans through the pathname string from left to right, normalizing it, while discarding the last pathname component.
Reviewed by: emaste, jilles Differential Revision: https://reviews.freebsd.org/D7355
|
H A D | Makefile.inc | diff e2f68161004f312bf10e4b683ac866b45f6e8489 Fri Aug 12 09:03:58 CEST 2016 Ed Schouten <ed@FreeBSD.org> Reimplement dirname(3) to be thread-safe.
Now that we've updated the prototypes of the basename(3) and dirname(3) functions to conform to POSIX, let's go ahead and reimplement dirname(3) in such a way that it's thread-safe, but also guaranteed to succeed. C libraries like glibc, musl and the one that's part of Solaris already follow such an approach.
Move the existing implementation to another source file, freebsd11_dirname.c to keep existing users of the API that pass in a constant string happy, using symbol versioning.
Put a new version of the function in dirname.c, obtained from CloudABI's C library. This version scans through the pathname string from left to right, normalizing it, while discarding the last pathname component.
Reviewed by: emaste, jilles Differential Revision: https://reviews.freebsd.org/D7355
|