summaryrefslogtreecommitdiff
path: root/m4/openat.m4
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* open: support O_CLOEXECPaul Eggert2017-08-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS, doc/posix-functions/open.texi: * doc/posix-functions/openat.texi: Document this. * lib/fcntl.in.h (O_CLOEXEC): Default to a nonzero value. (GNULIB_defined_O_CLOEXEC): New symbol. * lib/open.c: Include cloexec.h. (open): Support O_CLOEXEC. * lib/openat.c: Include cloexec.h. (rpl_openat): Support O_CLOEXEC. * lib/popen-safer.c: Do not include cloexec.h. (open_noinherit): Remove. (popen_safer): Use O_CLOEXEC instead of set_cloexec_flag. * lib/save-cwd.c: Do not include cloexec.h. (save_cwd): Use O_CLOEXEC instead of set_cloexec_flag. * m4/open-cloexec.m4: New file. * m4/open.m4 (gl_FUNC_OPEN): Require gl_PREPROC_O_CLOEXEC. Replace 'open' if O_CLOEXEC is not present. * m4/openat.m4 (gl_FUNC_OPENAT): Require gl_PREPROC_O_CLOEXEC. Replace 'openat' if O_CLOEXEC is not present. * modules/freopen (Depends-on): Depend on 'open' if replacing freopen. * modules/open (Files): Add m4/open-cloexec.m4. (Depends-on): Depend on cloexec if replacing 'open'. * modules/openat (Files): Add m4/open-cloexec.m4. (Depends-on): Depend on cloexec if replacing openat. * modules/popen-safer (Depends-on): Remove cloexec. * modules/save-cwd (Depends-on): Remove cloexec, and add fd-safer-flag and 'open'.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* ftruncate, fts, lstat, openat, raise: no 'static inline'Paul Eggert2012-11-291-2/+1
| | | | | | | | | | | | | | | * lib/ftruncate.c (chsize_nothrow): * lib/fts.c (opendirat, diropen): * lib/lstat.c (orig_lstat): * lib/openat.c (orig_openat): * lib/raise.c (raise_nothrow): Now static, not static inline. * m4/ftruncate.m4 (gl_PREREQ_FTRUNCATE): * m4/fts.m4 (gl_FUNC_FTS_CORE): * m4/lstat.m4 (gl_PREREQ_LSTAT): * m4/openat.m4 (gl_PREREQ_OPENAT): * m4/raise.m4 (gl_PREREQ_RAISE): Do not require AC_C_INLINE.
* lstat: Avoid "guessing no" when cross-compiling to glibc systems.Bruno Haible2012-05-041-2/+2
| | | | | | | | | | * m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): When cross- compiling, set gl_cv_func_lstat_dereferences_slashed_symlink to "guessing yes" or "guessing no". (gl_FUNC_LSTAT): Update. * m4/fstatat.m4 (gl_FUNC_FSTATAT): Update. * m4/openat.m4 (gl_FUNC_OPENAT): Update. * m4/unlinkat.m4 (gl_FUNC_UNLINKAT): Update.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* New modules 'at-internal', 'openat-h', split off from module 'openat'.Bruno Haible2011-11-051-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_OPENAT. Don't invoke gl_PREREQ_OPENAT and gl_MODULE_INDICATOR. * modules/openat (Description): Add reference to POSIX function. (Files): Remove lib/openat.h, lib/openat-proc.c. (Depends-on): Add at-internal, openat-h. Remove fdopendir, gettext-h, intprops, unistd. (configure.ac): Remove AC_LIBOBJ of openat-proc. Invoke gl_PREREQ_OPENAT, gl_MODULE_INDICATOR here. Invoke gl_FCNTL_MODULE_INDICATOR. (Include): Remove unistd.h, openat.h. * modules/areadlinkat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, extensions, fchdir, openat-die, openat-h, save-cwd. * modules/areadlinkat-with-size (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, extensions, fchdir, openat-die, openat-h, save-cwd, unistd. * modules/faccessat (Files): Add lib/at-func.c, lib/openat-priv.h. (Depends-on): Add at-internal, dosname, errno, fchdir, openat-die, openat-h, save-cwd. Remove fcntl-h, openat. * modules/fchmodat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, fcntl-h, openat, stdbool, unistd. * modules/fchownat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, fcntl-h, openat, stdbool, sys_stat. * modules/fdopendir (Files): Remove lib/openat-priv.h, lib/openat-proc.c. (Depends-on): Add at-internal. (condigure.ac): Remove AC_LIBOBJ of openat-proc. * modules/fstatat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, openat, stdbool, unistd. * modules/fts (Depends-on): Add openat-h. * modules/linkat (Depends-on): Add at-internal, openat-h. Remove openat. * modules/mkdirat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, fcntl-h, openat, stdbool, sys_stat. * modules/mkfifoat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, fchdir, openat-die, openat-h, save-cwd. Remove fcntl-h, openat. * modules/openat-die (Depends-on): Add openat-h. Remove openat. * modules/readlinkat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, fchdir, openat-die, openat-h, save-cwd. Remove fcntl-h, openat. * modules/renameat (Depends-on): Add at-internal, openat-h. Remove openat. * modules/selinux-at (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, extensions, fchdir, fcntl-h, openat-die, openat-h, save-cwd, unistd. Remove openat. * modules/symlinkat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, fchdir, openat-die, openat-h, save-cwd. Remove fcntl-h, openat. * modules/unlinkat (Files): Remove lib/openat.h. (Depends-on): Add at-internal, openat-h. Remove dirent, openat, stdbool. * modules/utimensat (Files): Add lib/at-func.c. (Depends-on): Add at-internal, dosname, errno, fchdir, fcntl-h, openat-die, openat-h, save-cwd. * modules/fchownat-tests (Depends-on): Add openat-h. Remove openat. * modules/fdutimensat-tests (Depends-on): Add openat. * modules/fstatat-tests (Depends-on): Add openat-h. * modules/readlinkat-tests (Depends-on): Add openat. * modules/symlinkat-tests (Depends-on): Add openat.
* New module 'mkdirat', split off from module 'openat'.Bruno Haible2011-11-041-8/+2
| | | | | | | | | | | | | | | | | | | * m4/mkdirat.m4: New file. extracted from m4/openat.m4. * m4/openat.m4 (gl_FUNC_OPENAT): Don't require gl_SYS_STAT_H_DEFAULTS. Don't test for mkdirat. Don't set GNULIB_MKDIRAT, HAVE_MKDIRAT. * modules/mkdirat: New file, extracted from modules/openat. * modules/openat (Files): Remove lib/mkdirat.c. (Depends-on): Remove mkdir. (configure.ac): Remove AC_LIBOBJ of mkdirat. (Include): Remove <sys/stat.h>. * modules/mkdirat-tests: New file, extracted from modules/openat-tests. * modules/openat-tests (Files): Remove tests/test-mkdirat.c, tests/test-mkdir.h. (Depends-on): Remove ignore-value. (Makefile.am): Remove rules for test-mkdirat. * doc/posix-functions/mkdirat.texi: Mention module 'mkdirat' instead of module 'openat'. * NEWS: Mention the change.
* New module 'fstatat', split off from module 'openat'.Bruno Haible2011-11-041-47/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * lib/openat.h (statat, lstatat): Enable only if GNULIB_FSTATAT is defined. * m4/fstatat.m4: New file. extracted from m4/openat.m4. * m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_FSTATAT. Don't invoke gl_FUNC_FSTATAT. (gl_FUNC_FSTATAT): Moved to m4/fstatat.m4. * modules/fstatat: New file, extracted from modules/openat. * modules/openat (Files): Remove lib/fstatat.c. (Depends-on): Remove lstat. (configure.ac): Remove AC_LIBOBJ of fstatat. * modules/fstatat-tests: New file, extracted from modules/openat-tests. * modules/openat-tests (Files): Remove tests/test-fstatat.c, tests/test-lstat.h, tests/test-stat.h. (Depends-on): Remove getcwd-lgpl. (Makefile.am): Remove rules for test-fstatat. * doc/posix-functions/fstatat.texi: Mention module 'fstatat' instead of module 'openat'. * NEWS: Mention the change. * modules/getcwd (Depends-on): Add fstatat. * modules/linkat (Depends-on): Likewise. * modules/mkfifoat-tests (Depends-on): Likewise. * modules/utimensat (Depends-on): Add fstatat. Remove openat.
* New module 'unlinkat', split off from module 'openat'.Bruno Haible2011-11-021-12/+3
| | | | | | | | | | | | | | | | | | | | | | * m4/unlinkat.m4: New file, extracted from m4/openat.m4. * m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_UNLINKAT, REPLACE_UNLINKAT, HAVE_UNLINKAT. Don't test for unlinkat. * modules/unlinkat: New file, extracted from modules/openat. Correct the dependency conditions. * modules/openat (Files): Remove lib/unlinkat.c. (Depends-on): Remove rmdir, unlink. (configure.ac): Remove AC_LIBOBJ of unlinkat. * modules/unlinkat-tests: New file, extracted from modules/openat-tests. * modules/openat-tests (Files): Remove tests/test-unlinkat.c, tests/test-rmdir.h, tests/test-unlink.h. (Depends-on): Remove unlinkdir. (Makefile.am): Remove rules for test-unlinkat. * doc/posix-functions/unlinkat.texi: Mention module 'unlinkat' instead of module 'openat'. * NEWS: Mention the change. * modules/linkat-tests (Depends-on): Add unlinkat. * modules/mkfifoat-tests (Depends-on): Likewise. * modules/readlinkat-tests (Depends-on): Likewise.
* New module 'fchmodat', split off from module 'openat'.Bruno Haible2011-11-021-6/+2
| | | | | | | | | | | | | | | | | * lib/openat.h (chmodat, lchmodat): Enable only if GNULIB_FCHMODAT is defined. * m4/fchmodat.m4: New file, extracted from m4/openat.m4. * m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_FCHMODAT. Don't test for fchmodat, lchmod. Don't set HAVE_FCHMODAT. * modules/fchmodat: New file, extracted from modules/openat. * modules/openat (Files): Remove lib/fchmodat.c. (configure.ac): Remove AC_LIBOBJ of fchmodat. * modules/fchmodat-tests: New file, extracted from modules/openat-tests. * modules/openat-tests (Files): Remove tests/test-fchmodat.c. (Makefile.am): Remove rules for test-fchmodat. * doc/posix-functions/fchmodat.texi: Mention module 'fchmodat' instead of module 'openat'. * NEWS: Mention the change.
* New module 'fchownat', split off from module 'openat'.Bruno Haible2011-11-011-103/+1
| | | | | | | | | | | | | | | | | | | | | | | * lib/openat.h (chownat, lchownat): Enable only if GNULIB_FCHOWNAT is defined. * m4/fchownat.m4: New file, extracted from m4/openat.m4. * m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_FCHOWNAT. Don't invoke gl_FUNC_FCHOWNAT. (gl_FUNC_FCHOWNAT_DEREF_BUG, gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG, gl_FUNC_FCHOWNAT): Moved to m4/fchownat.m4. * modules/fchownat: New file, extracted from modules/openat. * modules/openat (Files): Remove lib/fchownat.c. (Depends-on): Remove lchown. (configure.ac): Remove AC_LIBOBJ of fchownat. * modules/fchownat-tests: New file, extracted from modules/openat-tests. * modules/openat-tests (Files): Remove tests/test-fchownat.c, tests/test-chown.h, tests/test-lchown.h, tests/nap.h. (Depends-on): Remove mgetgroups, usleep, stat-time. (configure.ac): Remove test for getegid. (Makefile.am): Remove rules for test-fchownat. * doc/posix-functions/fchownat.texi: Mention module 'fchownat' instead of module 'openat'. * NEWS: Mention the change.
* getcwd: don't fail in a deep directory on a system without openatJim Meyering2011-09-191-0/+3
| | | | | | | | | | | | Before this change, getcwd would fail when called from a directory of depth PATH_MAX / 3 or greater. That was due to the fact that the non-openat implementation used "..", "../..", "../../..", etc. to access ancestor directories. With too many, that string would be longer than PATH_MAX. * lib/getcwd.c (HAVE_OPENAT_SUPPORT): Define also when we are using gnulib's openat replacement. * m4/openat.m4: Set GNULIB_OPENAT, so getcwd.c knows when we're using the replacement function.
* openat: test for fstatat (..., 0) bugPaul Eggert2011-09-031-11/+10
| | | | | | | | | | | | | | | | | | | Further testing with tar suggests that fstatat (..., 0) does not work in general, on AIX 7.1; see <http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00023.html>. So, give up entirely on AIX 7.1's fstatat, and fall back on our replacement fstatat (which is what older AIX releases were using anyway). * lib/fstatat.c (fstatat) [HAVE_FSTATAT]: Do not undef. The only use is now changed to orig_fstatat. This was probably the right thing to do anyway. (FSTATAT_AT_FDCWD_0_BROKEN): Remove; no longer used. (rpl_fstatat) [FSTATAT_ZERO_FLAG_BROKEN]: Remove. (rpl_fstatat): Simplify, assuming !FSTATAT_ZERO_FLAG_BROKEN. (AT_FUNC_NAME) [FSTATAT_ZERO_FLAG_BROKEN]: Now rpl_fstatat. * m4/openat.m4 (gl_FUNC_FSTATAT): Test for the more-general bug and define FSTATAT_ZERO_FLAG_BROKEN, not FSTATAT_AT_FDCWD_0_BROKEN, if the bug is found.
* openat: test for fstatat (AT_FDCWD, ..., 0) bugPaul Eggert2011-09-031-3/+32
| | | | | | | | | | | This tests for another fstatat bug on AIX 7.1: fstatat (AT_FDCWD, ..., 0) does not work. See <http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00015.html>. * lib/fstatat.c (FSTATAT_AT_FDCWD_0_BROKEN) (LSTAT_FOLLOWS_SLASHED_SYMLINK): Default to 0. (rpl_fstatat): Adjust so that it works around either (or both) bugs if present. * m4/openat.m4 (gl_FUNC_FSTATAT): Test for this fstatat bug.
* openat: work around AIX 7.1 fstatat issuePaul Eggert2011-09-011-47/+4
| | | | | | | | | | | | This should fix the problem that was not properly fixed in the previous change, dated 2011-08-30. * lib/fstatat.c: Include <sys/stat.h> twice, the first with __need_system_stat_h defined. (orig_fstatat) [HAVE_FSTATAT]: New function. (rpl_fstatat): Go back to the old way of doing things, except call orig_fstatat instead of fstatat. * m4/openat.m4 (gl_FUNC_FSTATAT): Remove unnecessary check for openat. Remove unnecessary check whether fstatat fills in st_size etc.
* openat: work around AIX 7.1 fstatat bugPaul Eggert2011-08-301-5/+62
| | | | | | | | | | | | | | Problem reported by Kevin Brott for GNU tar, in the thread containing <http://lists.gnu.org/archive/html/bug-tar/2011-08/msg00015.html>. * lib/fstatat.c (rpl_fstatat): Do not invoke underlying fstatat if FSTATAT_ST_SIZE_ETC_BROKEN. (fstatat) [FSTATAT_ST_SIZE_ETC_BROKEN && HAVE_FSTATAT]: #define to rpl_fstatat. * m4/openat.m4 (gl_FUNC_FSTATAT): New macro, with the fstatat-relevant part of gl_FUNC_OPENAT. Also, check for the AIX 7.1 bug, and use AC_CHECK_FUNCS_ONCE for fstatat. (gl_FUNC_OPENAT): Use it. Use AC_CHECK_FUNCS_ONCE for fchmodat, mkdirat, openat and unlinkat.
* openat: Respect rules for use of AC_LIBOBJ.Bruno Haible2011-06-161-10/+2
| | | | | | * m4/openat.m4 (gl_FUNC_OPENAT): Call AC_CHECK_FUNCS instead of AC_REPLACE_FUNCS. Move AC_LIBOBJ invocations from here... * modules/openat (configure.ac): ... to here.
* lstat, openat: Respect rules for use of AC_LIBOBJ.Bruno Haible2011-06-161-3/+3
| | | | | | | | | | | * m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Renamed from AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK. Set variable gl_cv_func_lstat_dereferences_slashed_symlink. Don't invoke AC_LIBOBJ. (gl_PREREQ_LSTAT): New macro, extracted from gl_FUNC_LSTAT. (gl_FUNC_LSTAT): Update. Remove gl_PREREQ_LSTAT code. * modules/lstat (configure.ac): Invoke AC_LIBOBJ and gl_PREREQ_LSTAT here. * m4/openat.m4 (gl_FUNC_OPENAT): Update.
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* openat: Work around glibc bug with fchownat() and empty file names.Bruno Haible2010-11-131-0/+38
| | | | | | | | * m4/openat.m4 (gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): New macro. (gl_FUNC_FCHOWNAT): Invoke it. * lib/fchownat.c (rpl_fchownat): Handle the empty file name specially. * doc/posix-functions/fchownat.texi: Document the glibc bug. Reported by Gary V. Vaughan <gary@gnu.org>.
* openat: Ensure autoconf macro ordering.Bruno Haible2010-11-131-1/+5
| | | | | | * m4/openat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): Require gl_USE_SYSTEM_EXTENSIONS. (gl_FUNC_FCHOWNAT): Require gl_UNISTD_H_DEFAULTS.
* fchownat: Replace also when chown has the trailing slash bug.Bruno Haible2010-07-311-9/+12
|
* openat: correct formatting (no semantic change)Jim Meyering2010-04-121-4/+6
| | | | | * m4/openat.m4 (gl_FUNC_FCHOWNAT): Correct formatting in AC_DEFINE. Suggested by Bruno Haible.
* fchownat: Fix a C++ test error on Solaris 8.Bruno Haible2010-04-101-5/+5
|
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Use AC_C_INLINE instead of module 'inline' where possible.Bruno Haible2009-12-311-1/+2
|
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-4/+4
|
* openat: detect Solaris fchownat bugEric Blake2009-11-141-2/+8
| | | | | | | | | | | | | | | | | | Solaris 9 fchownat(dir,"name/",uid,gid,flag) has same bugs as chown and lchown. * lib/fchownat.c (rpl_fchownat): Work around Solaris bug. Avoid penalizing glibc chownat when only lchownat is broken. * m4/openat.m4 (gl_FUNC_FCHOWNAT): Replace fchownat if there are trailing slash bugs. * doc/posix-functions/fchownat.texi (fchownat): Document the bug. * modules/openat-tests (Files): Include more files. (Depends-on): Add mgetgroups, sleep, stat-time. (configure.ac): Add additional checks. (Makefile.am): Build new test. * tests/test-fchownat.c: New file. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: fix GNU/Hurd bug in unlinkatEric Blake2009-10-061-2/+8
| | | | | | | | | | | unlinkat(fd,"file/",0) mistakenly succeeded. * m4/openat.m4 (gl_FUNC_OPENAT): Replace unlinkat if unlink is broken. * doc/posix-functions/unlink.texi (unlink): Document this. * doc/posix-functions/unlinkat.texi (unlinkat): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: fix openat bugs on Solaris 9Eric Blake2009-09-191-1/+3
| | | | | | | | | | | | | | openat(fd,"file/",O_RDONLY) mistakenly succeeded. * lib/openat.c (rpl_openat): Work around Solaris 9 bug. * m4/openat.m4 (gl_FUNC_OPENAT): Also replace openat on Solaris. * modules/openat (Depends-on): Add open. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Provide new default. * modules/fcntl-h (Makefile.am): Substitute it. * lib/fcntl.in.h (openat): Declare replacement. * doc/posix-functions/openat.texi (openat): Document this. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: move fstatat and unlinkat into correct filesEric Blake2009-09-191-2/+2
| | | | | | | | | | | | Code motion, should be no semantic changes. * m4/openat.m4 (gl_FUNC_OPENAT): Adjust which files will be compiled. * lib/openat.c (fstatat, unlinkat): Move... * lib/fstatat.c (fstatat): ...into correct files. * lib/unlinkat.c (unlinkat): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* openat: fix unlinkat bugs on Solaris 9Eric Blake2009-09-191-1/+5
| | | | | | | | | | | | | | | | unlinkat(fd,"file/",0) mistakenly succeeded. * lib/unlinkat.c (unlinkat): New file. * modules/openat (Depends-on): Add unlink. (Files): Distribute it. * m4/openat.m4 (gl_FUNC_OPENAT): Mark unlinkat for replacement if trailing slash behavior is broken. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness. * modules/unistd (Makefile.am): Substitute it. * lib/unistd.in.h (unlinkat): Declare replacement. * doc/posix-functions/unlinkat.texi (unlinkat): Document this. Signed-off-by: Eric Blake <ebb9@byu.net>
* Remove dependency from unistd_h.m4, sys_stat_h.m4, fcntl_h.m4 to openat.m4.Bruno Haible2009-09-071-16/+13
|
* openat: declare in POSIX headersEric Blake2009-09-031-16/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Mention this. * modules/openat (configure.ac): Declare witnesses. (Depends-on): Add fcntl-h, sys_stat, unistd. (Include): Mention correct headers. * modules/fcntl-h (Depends-on): Add link-warning. (Files): Add openat.m4. (Makefile.am): Substitute witnesses. * modules/sys_stat (Files, Makefile.am): Likewise. * modules/unistd (Files, Makefile.am): Likewise. * m4/openat.m4 (gl_FUNC_OPENAT, gl_FUNC_FCHOWNAT): Set witnesses. (gl_OPENAT_DEFAULTS): New macro. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Use it. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. (SYS_STAT_H): Remove unused variable. * doc/posix-headers/fcntl.texi (fcntl.h): Update content. * lib/fcntl--.h (includes): Remove unneeded header. * lib/openat-safer.c (includes): Likewise. * lib/openat.h (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR) (openat, fstatat, unlinkat, mkdirat, fchmodat, fchownat): Move to appropriate headers. (__OPENAT_PREFIX): Delete. * lib/fcntl.in.h (openat): Provide declaration. (AT_FDCWD): Fix Solaris bug. (AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR): Provide macros. * lib/sys_stat.in.h (fstatat, mkdirat): Provide declaration. * lib/fchmodat.c (includes): Adjust to find declaration. * lib/fchownat.c (includes): Likewise. * lib/mkdirat.c (includes): Likewise. * lib/fstatat.c (includes): Likewise. Ensure original fstatat is still visible. Signed-off-by: Eric Blake <ebb9@byu.net>
* fdopendir: split into its own moduleEric Blake2009-09-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | * lib/openat.c (fdopendir): Move... * lib/fdopendir.c: ...into new file. * modules/fdopendir: New module. * m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): New file. * modules/openat (Depends-on): Add fdopendir. * m4/openat.m4 (gl_FUNC_OPENAT): No longer need to check for fdopendir here. * modules/savedir (Depends-on): Only need fdopendir, not full openat. * lib/savedir.c (include): Use <dirent.h>, not "openat.h". * lib/openat.h (fdopendir): Drop prototype. * lib/dirent.in.h (fdopendir): Provide prototype. * m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): Add replacements. * modules/dirent (Makefile.am): Substitute them. * MODULES.html.sh (File system functions): Mention it. * doc/posix-functions/fdopendir.texi (fdopendir): Likewise. * modules/fdopendir-tests: New file. * tests/test-fdopendir.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* Simplify use of mode_t varargs.Bruno Haible2009-05-221-1/+2
|
* many *.m4 files: improve m4 quotingJim Meyering2009-01-141-4/+4
| | | | | | | | | | | | | | | | 99% of this change was performed by running the following commands: git ls-files | grep '\.m4$' | xargs perl -pi \ -e 's/(AC_\w+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_\w+\((?:\[[^,]+?\], ){1})([^,[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_\w+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g;' \ -e 's/(AC_\w+\((?:\[[^,]+?\], ){3})([^,[()]+?)([,)])/$1\[$2]$3/g' perl -pi -e 's/\[\.\.\.\]/.../' m4/onceonly.m4 The remainder were to add Copyright dates, increment serial numbers, undo some changes in comments, exclude m4/intl.m4, and add quotes around the "1" in ",1" where the unusual spacing prohibited the above regexps from doing the job. For more details, see <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16175>.
* Use native fstatat on cygwin 1.7.0.Eric Blake2008-04-251-3/+4
| | | | | | | * m4/openat.m4 (gl_FUNC_OPENAT): Make sure lstat check is made first. Signed-off-by: Eric Blake <ebb9@byu.net>
* Fix buggy test for the fchownat-deref bug.Jim Meyering2007-05-201-4/+2
| | | | | | | | | * m4/openat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): Create the dangling symlink required for the run-test. Without it, this test would always declare that fchownat doesn't work, and client code would unnecessarily use the replacement function with fixed libc. (gl_FUNC_FCHOWNAT): Eliminate a variable that wasn't initialized. Reported by Greg Schafer.
* (gl_FUNC_OPENAT): Do not require openat-dieSergey Poznyakoff2007-05-121-1/+0
|