lib/unistd.in.h


Log

Author Commit Date CI Message
Peter O'Gorman b111537c 2010-05-05T21:09:38 New module pwrite.
Bruno Haible a731808a 2010-04-25T20:57:52 ttyname_r: Make it work on MacOS X 10.4 and Solaris 10.
Bruno Haible 3c65a680 2010-04-10T21:11:00 write: Fix a C++ test error on mingw.
Bruno Haible c51b01fd 2010-04-03T15:59:25 fchdir: Fix regression introduced on 2010-03-08.
Bruno Haible e25c6d9c 2010-04-03T15:43:45 getpagesize: Fix C++ test error on mingw.
Bruno Haible cba80c66 2010-04-03T12:30:09 unistd: Fix C++ test error on mingw.
Bruno Haible cd265999 2010-03-28T14:26:15 unistd: Avoid #define replacements in C++ mode.
Eric Blake 40aa4775 2010-03-25T16:28:02 maint: use pragma consistently across replacement headers Several headers set #pragma GCC system_header prior to checking any multiple inclusion guards; maintenance is easiest if all replacement headers follow the same paradigm. * lib/ctype.in.h (system_header): Hoist for consistent placement. * lib/dirent.in.h (system_header): Likewise. * lib/errno.in.h (system_header): Likewise. * lib/float.in.h (system_header): Likewise. * lib/getopt.in.h (system_header): Likewise. * lib/iconv.in.h (system_header): Likewise. * lib/inttypes.in.h (system_header): Likewise. * lib/langinfo.in.h (system_header): Likewise. * lib/locale.in.h (system_header): Likewise. * lib/math.in.h (system_header): Likewise. * lib/netdb.in.h (system_header): Likewise. * lib/netinet_in.in.h (system_header): Likewise. * lib/pty.in.h (system_header): Likewise. * lib/sched.in.h (system_header): Likewise. * lib/se-selinux.in.h (system_header): Likewise. * lib/search.in.h (system_header): Likewise. * lib/spawn.in.h (system_header): Likewise. * lib/stdarg.in.h (system_header): Likewise. * lib/stdint.in.h (system_header): Likewise. * lib/string.in.h (system_header): Likewise. * lib/strings.in.h (system_header): Likewise. * lib/sys_file.in.h (system_header): Likewise. * lib/sys_ioctl.in.h (system_header): Likewise. * lib/sys_socket.in.h (system_header): Likewise. * lib/sys_times.in.h (system_header): Likewise. * lib/sys_utsname.in.h (system_header): Likewise. * lib/sys_wait.in.h (system_header): Likewise. * lib/sysexits.in.h (system_header): Likewise. * lib/unistd.in.h (system_header): Likewise. * lib/wctype.in.h (system_header): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 7bacd338 2010-03-22T14:01:55 gethostname: further tweaks * lib/unistd.in.h (includes): Only worry about <winsock2.h> if we are overriding gethostname. Suggested by Bruno Haible. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 33909664 2010-03-19T16:57:28 gethostname: fix build on mingw Since commit 4e86671a, gethostname failed to compile on mingw. Gnulib's sys/socket.h includes winsock2.h, which then includes unistd.h prior to declaring gethostname. The fix is to ensure that our replacement unistd.h does not declare any replacements until we are sure that winsock2.h is completely included. * lib/unistd.in.h (includes): Work around fact that mingw <winsock2.h> re-includes <unistd.h>, by avoiding any redeclarations if we are being included by <winsock2.h>. Reported by Matthias Bolte. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible 116440ae 2010-03-21T14:38:25 New module 'ttyname_r'.
Bruno Haible cf5e3a18 2010-03-19T23:22:28 getusershell: Provide declaration, missing on Solaris 9.
Bruno Haible d2a61622 2010-03-08T01:47:37 unistd: Avoid #define replacements in C++ mode.
Bruno Haible 89e5b6ba 2010-03-06T19:49:34 Clarify access, euidaccess, faccessat.
Eric Blake cbd5934b 2009-12-16T16:20:28 warn-on-use: use instead of link-warning Each *.in.h file serves two purposes - provide enough self-contained content to serve as a replacement for the system header regardless of the user's compiler, and offer the developer the ability to detect any gnulib modules that might have been inadvertantly excluded. The former requires independence from config.h, and routes everything through a Makefile.am snippet that uses @@ substitution specific to the modules that were in use, with details learned at configure time. The latter works by poisoning anything that gnulib did not replace, but which the developer had natively available, explaining why their tests passed during development. Poisoning relies on gcc features, and requires manual triggering by adding -DGNULIB_POSIXCHECK to CFLAGS; it assumes that <config.h> is properly included. In fact, we do not want to use @@ substitution for HAVE_DECL_* during poisoning, because the warning is only relevant for the gnulib modules which were not included, and thus where the m4 macros to set proper @@ values have not been run. Furthermore, we only need to poison interfaces that already have a declaration; if something is not declared, then the developer wouldn't have been able to link, so their code won't be using the problematic interface in the first place. * modules/stdio (Depends-on, Makefile.am): Drop link-warning. * modules/unistd (Depends-on, Makefile.am): Likewise. * modules/arpa_inet (Depends-on): Replace link-warning with warn-on-use. (Makefile.am): Update rules accordingly. * modules/ctype (Depends-on, Makefile.am): Likewise. * modules/dirent (Depends-on, Makefile.am): Likewise. * modules/fcntl-h (Depends-on, Makefile.am): Likewise. * modules/inttypes (Depends-on, Makefile.am): Likewise. * modules/langinfo (Depends-on, Makefile.am): Likewise. * modules/locale (Depends-on, Makefile.am): Likewise. * modules/math (Depends-on, Makefile.am): Likewise. * modules/search (Depends-on, Makefile.am): Likewise. * modules/signal (Depends-on, Makefile.am): Likewise. * modules/spawn (Depends-on, Makefile.am): Likewise. * modules/stdlib (Depends-on, Makefile.am): Likewise. * modules/string (Depends-on, Makefile.am): Likewise. * modules/strings (Depends-on, Makefile.am): Likewise. * modules/sys_file (Depends-on, Makefile.am): Likewise. * modules/sys_ioctl (Depends-on, Makefile.am): Likewise. * modules/sys_select (Depends-on, Makefile.am): Likewise. * modules/sys_socket (Depends-on, Makefile.am): Likewise. * modules/sys_stat (Depends-on, Makefile.am): Likewise. * modules/sys_times (Depends-on, Makefile.am): Likewise. * modules/sys_utsname (Depends-on, Makefile.am): Likewise. * modules/wchar (Depends-on, Makefile.am): Likewise. * m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): Check which functions should be poisoned. * m4/ctype.m4 (gl_CTYPE_H): Likewise. * m4/dirent_h.m4 (gl_DIRENT_H): Likewise. * m4/fcntl_h.m4 (gl_FCNTL_H): Likewise. * m4/inttypes.m4 (gl_INTTYPES_H): Likewise. * m4/langinfo_h.m4 (gl_LANGINFO_H): Likewise. * m4/locale_h.m4 (gl_LOCALE_H): Likewise. * m4/math_h.m4 (gl_MATH_H): Likewise. * m4/search_h.m4 (gl_SEARCH_H): Likewise. * m4/signal_h.m4 (gl_SIGNAL_H): Likewise. * m4/spawn_h.m4 (gl_SPAWN_H): Likewise. * m4/stdio_h.m4 (gl_STDIO_H): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Likewise. * m4/strings_h.m4 (gl_HEADER_STRINGS_H_BODY): Likewise. * m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H_DEFAULTS): Likewise. * m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H): Likewise. * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise. * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Likewise. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Likewise. * m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise. * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H): Likewise. * m4/wchar.m4 (gl_WCHAR_H): Likewise. * lib/arpa_inet.in.h: Use _GL_WARN_ON_USE instead of GL_LINK_WARNING. * lib/ctype.in.h: Likewise. * lib/dirent.in.h: Likewise. * lib/fcntl.in.h: Likewise. * lib/inttypes.in.h: Likewise. * lib/langinfo.in.h: Likewise. * lib/locale.in.h: Likewise. * lib/math.in.h: Likewise. * lib/search.in.h: Likewise. * lib/signal.in.h: Likewise. * lib/spawn.in.h: Likewise. * lib/stdio.in.h: Likewise. * lib/stdlib.in.h: Likewise. * lib/string.in.h: Likewise. * lib/strings.in.h: Likewise. * lib/sys_file.in.h: Likewise. * lib/sys_ioctl.in.h: Likewise. * lib/sys_select.in.h: Likewise. * lib/sys_socket.in.h: Likewise. * lib/sys_stat.in.h: Likewise. * lib/sys_times.in.h: Likewise. * lib/sys_utsname.in.h: Likewise. * lib/unistd.in.h: Likewise. * lib/wchar.in.h: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 718991da 2009-12-31T13:28:59 unistd: warn on use of environ without module _GL_WARN_ON_USE only works for functions; so we wrap access to environ through a function when CFLAGS has -DGNULIB_POSIXCHECK=1. * modules/unistd (Depends-on): Add warn-on-use. (Makefile.am): Provide new substitutions. * m4/unistd_h.m4 (gl_UNISTD_H): Check for inline and environ. * lib/unistd.in.h (environ): Wrap with a warning helper function. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 90773484 2010-01-09T16:17:50 New module 'getlogin'.
Bruno Haible 3361cfa6 2010-01-09T14:16:57 getlogin_r: Add comment.
Eric Blake 60ad192b 2010-01-06T07:09:03 stdio, unistd: guarantee ssize_t Per POSIX 2008, ssize_t needs to exist whether or not we are replacing functions that use it. For now, we only guarantee it if we know that the user expects a function that uses that type, while waiting for glibc to catch up to POSIX. * lib/unistd.in.h (includes): Ensure that types required by POSIX 2008 are exposed when needed. * lib/stdio.in.h (includes): Likewise. Reported by Ralf Wildenhues. Signed-off-by: Eric Blake <ebb9@byu.net>
Jim Meyering b2e2010c 2010-01-01T10:31:12 update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
Eric Blake c47e75a9 2009-12-30T16:14:05 unistd: fix typo This typo ended up incompatibly re-defining the macro link() during -DGNULIB_POSIXCHECK=1. However, gcc's pragma system_header squelches that particular warning, so this typo went unnoticed. * lib/unistd.in.h (linkat) [GNULIB_POSIXCHECK]: Fix typo. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible d19dfc69 2009-12-24T16:59:36 Reduce namespace pollution on glibc systems.
Eric Blake d3e8c326 2009-12-24T06:01:43 build: pull in conditional headers during GNULIB_POSIXCHECK Any time we conditionally include a header in order to satisfy prerequisites of one module, we must also include that header under GNULIB_POSIXCHECK to avoid compilation errors if that module is not in use. If this is not done, then our link warning override can occur before the system's declaration, which causes a syntax error when the system header is finally included. * lib/stdio.in.h (includes): Using GNULIB_POSIXCHECK also requires definitions from any conditionally-included headers. * lib/stdlib.in.h (includes): Likewise. * lib/unistd.in.h (includes): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 86c22b43 2009-12-23T18:42:59 unistd: work around cygwin bug Cygwin 1.7.1 placed symlinkat and unlinkat in the wrong headers (due to a bug in the Linux man pages). * lib/unistd.in.h (includes): Pick up headers needed for cygwin. * doc/posix-functions/unlinkat.texi (unlinkat): Document the bug. * doc/posix-functions/symlinkat.texi (symlinkat): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 44f52a54 2009-12-23T10:59:14 unistd: Ensure getcwd gets declared before being overridden.
Eric Blake adbded99 2009-12-21T11:32:58 math, unistd: avoid redundant includes * lib/math.in.h (isnan): No need to re-include <math.h>. * lib/unistd.in.h (getcwd): Likewise, for <stdlib.h>. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 69482508 2009-12-11T01:15:28 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible 441aa304 2009-12-10T20:28:30 Use spaces for indentation, not tabs.
Jim Meyering 8def010e 2009-11-25T17:06:25 unistd.in.h: correct declaration of pread * lib/unistd.in.h: Correct type of "buf" parameter: void*, not char* Reported by Richard W.M. Jones.
Jim Meyering f84e1a91 2009-11-25T14:33:30 pread: new module * modules/pread: New file. * lib/pread.c (pread): New file. * m4/pread.m4: Likewise. * lib/unistd.in.h (pread): Define/declare. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Define defaults. * modules/unistd (Makefile.am): Substitute witnesses. * doc/posix-functions/pread.texi (pread): Update. * MODULES.html.sh: Add pread.
Eric Blake 6baa4663 2009-11-18T20:07:44 sleep: work around cygwin bug On cygwin 1.5.x, sleep amounts larger than 49.7 days (2**32 milliseconds) failed instantly, but with a garbage return value from uninitialized memory. * lib/sleep.c (rpl_sleep): Work around the bug. * m4/sleep.m4 (gl_FUNC_SLEEP): Detect the bug. (gl_PREREQ_SLEEP): Delete unused macro. * modules/sleep (Depends-on): Add verify. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add default. * modules/unistd (Makefile.am): Substitute witness. * lib/unistd.in.h (sleep): Update prototype. * doc/posix-functions/sleep.texi (sleep): Document the bug. * tests/test-sleep.c (main) [HAVE_DECL_ALARM]: Test it. * modules/sleep-tests (Depends-on): Check for alarm. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake e8eecfd3 2009-11-17T09:24:56 usleep: new module mingw usleep(1000000) failed with EINVAL, as allowed by POSIX, but contrary to GNU usage. Rather than implement an accurate usleep based on select or nanosleep, both of which drag in dependencies on external libraries, this version intentionally takes the ceiling in seconds if usleep() is missing. * modules/usleep: New file. * m4/usleep.m4 (gl_FUNC_USLEEP): Likewise. * lib/usleep.c (usleep): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add defaults. * modules/unistd (Makefile.am): Substitute witnesses. * lib/unistd.in.h (usleep): Add declaration. * doc/pastposix-functions/usleep.texi (usleep): Document this. * MODULES.html.sh (Date and time): Likewise. * modules/usleep-tests (Depends-on): New test. * tests/test-usleep.c: New file. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 6bd10238 2009-11-12T21:45:20 lchown: detect Solaris and FreeBSD bug Solaris 9 and FreeBSD 7.2 lchown("link-to-file/",uid,gid) mistakenly changes ownership of "file". * lib/lchown.c (rpl_lchown): Work around bug. * m4/lchown.m4 (gl_FUNC_LCHOWN): Check for trailing slash bugs. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness. * modules/unistd (Makefile.am): Populate it. * lib/unistd.in.h (lchown): Update declaration. * doc/posix-functions/lchown.texi (lchown): Document the bug. * modules/lchown-tests: New file. * tests/test-lchown.h (test_lchown): Likewise. * tests/test-lchown.c (main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 9cd8acba 2009-11-12T21:45:20 chown: detect Solaris and FreeBSD bug Solaris 9 and FreeBSD 7.2 chown("link-to-file/",uid,gid) mistakenly changes ownership of "file". * lib/chown.c (rpl_chown): Work around bug. * m4/chown.m4 (gl_FUNC_CHOWN): Check for trailing slash bugs. (gl_PREREQ_CHOWN): Delete. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness. * modules/unistd (Makefile.am): Populate it. * lib/unistd.in.h (chown): Update declaration. * lib/lchown.c (chown): Update client. * modules/lchown (Depends-on): Add lstat. * doc/posix-functions/chown.texi (chown): Document the bug. * doc/posix-functions/getgroups.texi (getgroups): Document getgroups pitfall. * modules/chown-tests: New file. * tests/test-chown.h (test_chown): Likewise. * tests/test-chown.c (main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 6e4b15b5 2009-11-12T10:19:39 getgroups: don't expose GETGROUPS_T to user These days, most systems already declare getgroups with gid_t*. But in the rare case that GETGROUPS_T is still int but gid_t is short, the user should not have to uglify their code; let the replacement hide all the magic. Tested by configuring with ac_cv_type_getgroups=uint64_t on a platform with 32-bit gid_t, and ignoring compiler warnings. However, since we don't replace setgroups, the GETGROUPS_T workaround is still needed there for now. * lib/getgroups.c (rpl_getgroups): Change signature. Copy array an element at a time if GETGROUPS_T is wrong size. * lib/getugroups.h (getugroups): Change signature. * lib/unistd.in.h (getgroups): Likewise. * m4/getgroups.m4 (gl_FUNC_GETGROUPS): Use replacement if signature needs fixing. * m4/getugroups.m4 (gl_GETUGROUPS): No longer need AC_TYPE_GETGROUPS. * modules/group-member (Depends-on): Add getgroups. * lib/group-member.c (group_info, get_group_info): Use gid_t. (group_member): Rely on getgroups replacement. * lib/getugroups.c (getugroups): Use gid_t. * tests/test-getgroups.c (main): Likewise. * NEWS: Mention the signature change. * doc/posix-functions/getgroups.texi (getgroups): Mention the problem with signature. * doc/glibc-functions/setgroups.texi (setgroups): Mention that GETGROUPS_T is still useful for setgroups. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 61b3a422 2009-11-12T09:53:14 getgroups, getugroups: provide stubs for mingw Avoid link failure on mingw, which lacks getgroups and anything else related to gid_t management (stat.st_gid is always 0). * lib/getgroups.c (getgroups): Provide ENOSYS stub for mingw. * lib/getugroups.c (getugroups): Likewise. * m4/getgroups.m4 (gl_FUNC_GETGROUPS): Check for missing function. Modernize replacement scheme. (gl_PREREQ_GETGROUPS): Delete. * m4/getugroups.m4 (gl_GETUGROUPS): Check for <grp.h>. * modules/getgroups (configure.ac): Declare witness. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add default. * modules/unistd (Depends-on): Substitute witness. * lib/unistd.in.h (getgroups): Declare replacement. Signed-off-by: Eric Blake <ebb9@byu.net>
Jim Meyering d984c0bc 2009-10-08T18:25:39 unistd: fix comment typo * lib/unistd.in.h (euidaccess): Fix a comment typo.
Eric Blake 09e22b5a 2009-10-06T20:44:13 getopt: fix compilation on darwin * lib/getopt.in.h (includes): Leave breadcrumbs during system include. * lib/unistd.in.h (getopt): Use them to avoid recursive include. Reported by Ludovic Courtès. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake cdba659e 2009-10-05T21:30:33 linkat: support Linux 2.6.17 * m4/linkat.m4 (gl_FUNC_LINKAT): Default to always replacing linkat on Linux, but allow cache variable override. * lib/linkat.c (rpl_linkat): Define override. * modules/linkat (Depends-on): Add symlinkat. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add new default. * modules/unistd (Makefile.am): Substitute it. * lib/unistd.in.h (linkat): Declare replacement. Reported by Pádraig Brady. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake c4194dcc 2009-09-08T20:47:40 linkat: new module * modules/linkat: New file. * lib/at-func2.c (at_func2): Likewise. * lib/linkat.c (linkat): Likewise. * m4/linkat.m4 (gl_FUNC_LINKAT): Likewise. * lib/openat-priv.h (at_func2): Add declaration. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witnesses. * modules/unistd (Makefile.am): Substitute them. * lib/unistd.in.h (linkat): Declare it. * MODULES.html.sh (systems lacking POSIX:2008): Mention module. * doc/posix-functions/linkat.texi (linkat): Likewise. * doc/posix-functions/link.texi (link): Tweak wording. * tests/test-link.c (main): Move guts... * tests/test-link.h (test_link): ...into new file. * modules/linkat-tests: New test. * tests/test-linkat.c: Likewise. * modules/link-tests (Files): Ship new file. (Depends-on): Add stdbool. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 5b192b39 2009-09-22T17:14:23 readlink: fix cygwin 1.5.x bug with return type On older systems, readlink returned int instead of ssize_t, making the use of readlink via function pointer harder. * m4/readlink.m4 (gl_FUNC_READLINK): Require correct signature. * lib/unistd.in.h (readlink): Use ssize_t. * lib/readlink.c (readlink): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness. * modules/unistd (Makefile.am): Substitute it. * lib/unistd.in.h (readlink): Declare replacement. * doc/posix-functions/readlink.texi (readlink): Document this. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake d9d5054c 2009-09-19T21:20:42 symlink: new module, for Solaris 9 bug symlink("a","link/") mistakenly succeeds. * modules/symlink: New file. * m4/symlink.m4 (gl_FUNC_SYMLINK): Likewise. * lib/symlink.c: Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add defaults. * modules/unistd (Makefile.am): Substitute them. * lib/unistd.in.h (symlink): Declare replacement. * MODULES.html.sh (File system functions): Mention it. * doc/posix-functions/symlink.texi (symlink): Likewise. * modules/symlink-tests: New test. * tests/test-symlink.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake d34f1e73 2009-09-19T20:37:50 unistd: sort replacement declarations * lib/unistd.in.h: Sort declarations. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 22d7496b 2009-09-18T19:39:06 openat: fix unlinkat bugs on Solaris 9 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>
Eric Blake 4a60ba54 2009-09-16T17:13:20 unlink: new module, for Solaris 9 bug unlink("file/") mistakenly succeeded. This patch favors, but does not enforce, GNU semantics that unlink("link-to-dir/") flat-out fails rather than attempting to unlink "dir". * modules/unlink: New file. * lib/unlink.c: Likewise. * m4/unlink.m4 (gl_FUNC_UNLINK): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witnesses. * modules/unistd (Makefile.am): Use them. * lib/unistd.in.h (stat): Declare replacement. * MODULES.html.sh (systems lacking POSIX:2008): Mention module. * doc/posix-functions/unlink.texi (unlink): Likewise. * modules/unlink-tests: New test. * tests/test-unlink.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake b433e645 2009-09-16T10:08:55 rmdir: work around cygwin 1.5.x and mingw bugs * m4/rmdir.m4 (gl_FUNC_RMDIR): Detect the bugs. * lib/rmdir.c (rmdir): Work around it. * modules/rmdir (Status, Notice): No longer obsolete. (Files): Add dos.m4. (Depends-on): Add unistd. (configure.ac): Set witnesses. (License): Relax to LGPLv2+. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set defaults. * modules/unistd (Makefile.am): Substitute witnesses. * lib/unistd.in.h (rmdir): Declare replacement. * doc/posix-functions/rmdir.texi (rmdir): Document this. * modules/rmdir-tests: New tests. * tests/test-rmdir.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake c9dd0005 2009-09-15T15:54:43 fchdir: improve use of replacement functions * m4/fchdir.m4 (gl_FUNC_FCHDIR): Set appropriate witnesses. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Add REPLACE_FSTAT. * m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): Add REPLACE_OPENDIR, REPLACE_CLOSEDIR. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add REPLACE_DUP. * modules/sys_stat (Makefile.am): Substitute correct witness. * modules/dirent (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * lib/dirent.in.h (opendir, closedir): Use better witnesses. * lib/unistd.in.h (dup): Likewise. * lib/sys_stat.in.h (fstat): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 2d9360ff 2009-09-09T15:25:26 link: fix platform bugs * m4/link.m4 (gl_FUNC_LINK): Detect Solaris and Cygwin bugs. * lib/link.c (link): Work around them. Fix related mingw bug. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add REPLACE_LINK. * modules/unistd (Makefile.am): Substitute it. * lib/unistd.in.h (link): Declare replacement. * doc/posix-functions/link.texi (link): Document this. * modules/link (Depends-on): Add strdup-posix, sys_stat. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 370fec14 2009-09-07T05:28:13 openat: provide more convenience names * modules/faccessat (configure.ac): Add C witness. * lib/unistd.in.h (readlinkat): Fix typo. * lib/openat.h (statat, lstatat, accessat, euidaccessat): New convenience wrappers. * top/maint.mk (sc_prohibit_openat_without_use): Allow these wrappers in syntax checks. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake aa686284 2009-09-06T20:53:59 faccessat, symlinkat: continue cleanup of previous patch * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Ensure dependency order. * m4/faccessat.m4 (gl_FUNC_FACCESSAT): Likewise. * modules/unistd (Makefile.am): Substitute GNULIB_READLINKAT. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Offer GNULIB_READLINKAT. * modules/symlinkat (configure.ac): Set GNULIB_READLINKAT. * lib/unistd.in.h (readlinkat): Declare if GNULIB_READLINKAT is set. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 1e2ae3ac 2009-09-07T01:33:12 Remove dependency from unistd_h.m4, sys_stat_h.m4, fcntl_h.m4 to openat.m4.
Eric Blake ac181274 2009-09-05T11:49:15 symlinkat: new module * modules/symlinkat: New file. * lib/symlinkat.c: Likewise. * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witnesses. * modules/unistd (Makefile.am): Use them. * lib/unistd.in.h (symlinkat, readlinkat): Declare them. (faccessat) [GNULIB_POSIXCHECK]: Fix typo. * lib/at-func.c (FUNC_RESULT): New macro, defaulting to int. * MODULES.html.sh (File system functions): Mention module. * doc/posix-functions/symlinkat.texi (symlinkat): Likewise. * doc/posix-functions/readlinkat.texi (readlinkat): Likewise. * modules/symlinkat-tests: New test. * tests/test-symlinkat.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 973333dc 2009-09-03T13:41:18 faccessat: new module * modules/faccessat: New file. * lib/faccessat.m4: Likewise. * m4/faccessat.m4 (gl_FUNC_FACCESSAT): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness. * modules/unistd (Makefile.am): Use it. * lib/unistd.in.h (faccessat): Declare it. (F_OK, X_OK, W_OK, R_OK): Provide definitions. * lib/fcntl.in.h (AT_SYMLINK_FOLLOW, AT_EACCESS): Likewise. * MODULES.html.sh (File system functions): Mention it. * doc/posix-functions/faccessat.texi (faccessat): Likewise. * doc/posix-headers/fcntl.texi (fcntl.h): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 52c658e9 2009-09-02T17:14:26 openat: declare in POSIX headers * 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>
Eric Blake eeb36a48 2009-09-01T10:05:44 fdopendir: optimize on mingw * lib/unistd.in.h (_gl_directory_name): New prototype. * lib/fchdir.c (_gl_directory_name): Implement it. (fchdir): Use it to simplify implementation. * lib/fdopendir.c (fdopendir) [REPLACE_FCHDIR]: Use metadata from fchdir, when available, to avoid calling [f]chdir(). Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake dd66a62c 2009-09-01T09:18:16 fchdir: use more consistent macro convention * lib/fcntl.in.h (_gl_register_fd): Move declaration to unistd. * lib/sys_stat.in.h (rpl_fstat): Declare via make-time REPLACE_FCHDIR, rather than relying on config.h macros. * lib/unistd.in.h (fchdir): Move all fchdir internal declarations inside a single make-time REPLACE_FCHDIR block, rather than using the config.h FCHDIR_REPLACEMENT. * m4/fchdir.m4 (gl_FUNC_FCHDIR): REPLACE_FCHDIR was already AC_SUBST'd, also AC_DEFINE it. Don't define FCHDIR_REPLACEMENT. Manage fstat replacement. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Pick up REPLACE_FCHDIR. * modules/sys_stat (Files): Add m4/unistd_h.m4. (Makefile.am): Substitute REPLACE_FCHDIR. * lib/close.c (rpl_close): Use REPLACE_FCHDIR, not FCHDIR_REPLACEMENT. * lib/dup-safer.c (dup_safer): Likewise. * lib/dup2.c (rpl_dup2): Likewise. * lib/dup3.c (rpl_dup3): Likewise. * lib/open.c (rpl_open): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 4475e25b 2009-08-31T14:20:03 fchdir: simplify error handling, and support dup3 * modules/fchdir (Depends-on): Use strdup-posix, not strdup. Add stdbool, malloc-posix, realloc-posix. * lib/fchdir.c (struct dir_info_t): Delete saved_errno. (ensure_dirs_slot): Return false on allocation failure. (rpl_dup2): Delete. (_gl_register_dup): New function. (_gl_unregister_fd, rpl_opendir, rpl_dup): Update callers. (_gl_register_fd): Close fd on allocation failure. * lib/fcntl.in.h (_gl_register_fd): Update signature. * lib/unistd.in.h (_gl_register_dup) [FCHDIR_REPLACEMENT]: New prototype. (rpl_dup2_fchdir): Delete prototype. * lib/open.c (open): Update caller. * lib/dup2.c (dup2): Track fchdir metadata. * lib/dup3.c (dup3): Likewise. * m4/dup2.m4 (gl_REPLACE_DUP2): New macro. * m4/fchdir.m4 (gl_FUNC_FCHDIR): Use it. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 49e5954e 2009-08-24T00:56:31 Tolerate declared but missing dup3 syscall.
Bruno Haible b23a8463 2009-08-24T00:42:22 Tolerate declared but missing pipe2 syscall.
Bruno Haible c2462636 2009-08-24T00:17:47 New module 'dup3'.
Bruno Haible a7b40bdb 2009-08-23T21:55:26 Fix getdtablesize() on mingw.
Bruno Haible f2adc007 2009-08-23T02:39:38 Improve comment about pipe2.
Bruno Haible 7988d730 2009-08-22T18:46:44 New module 'pipe2'.
Eric Blake 2f5181b1 2009-08-12T10:23:03 stddef: fix NetBSD 5.0 NULL bug, rather than working around it * tests/test-locale.c: Revert previous patch related to NULL. * tests/test-stdio.c: Likewise. * tests/test-stdlib.c: Likewise. * tests/test-string.c: Likewise. * tests/test-unistd.c: Likewise. * modules/time-tests (Depends-on): Add verify. * modules/wchar-tests (Depends-on): Likewise. * tests/test-time.c: Test for NULL compliance. * tests/test-wchar.c: Likewise. * modules/locale (Depends-on): Add stddef. * modules/stdio (Depends-on): Likewise. * modules/stdlib (Depends-on): Likewise. * modules/string (Depends-on): Likewise. * modules/time (Depends-on): Likewise. * modules/unistd (Depends-on): Likewise. * modules/wchar (Depends-on): Likewise. * lib/locale.in.h (includes): Use <stddef.h> to fix NULL. * lib/stdlib.in.h (includes): Likewise. * lib/string.in.h (includes): Likewise. * lib/time.in.h (includes): Likewise. * lib/unistd.in.h (includes): Likewise. * m4/locale_h.m4 (gl_LOCALE_H): Replace locale.h if stddef.h was replaced. * m4/wchar.m4 (gl_WCHAR_H): Likewise. * m4/stddef_h.m4: New file. * modules/stddef: Likewise. * lib/stddef.in.h: Likewise. * modules/stddef-tests: Likewise. * tests/test-stddef.c: Likewise. * MODULES.html.sh (Basic types <stddef.h>): Mention new module. * doc/posix-headers/stddef.texi (stddef.h): Document the bug. * doc/posix-headers/locale.texi (locale.h): Likewise. * doc/posix-headers/stdio.texi (stdio.h): Likewise. * doc/posix-headers/stdlib.texi (stdlib.h): Likewise. * doc/posix-headers/string.texi (string.h): Likewise. * doc/posix-headers/time.texi (time.h): Likewise. * doc/posix-headers/unistd.texi (unistd.h): Likewise. * doc/posix-headers/wchar.texi (wchar.h): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible b8d582b5 2009-08-12T17:25:09 Ensure that getopt() gets declared by <unistd.h>.
Bruno Haible 7f8441f9 2009-08-10T23:00:13 Make it possible to use module 'gethostname' without module 'close' or 'ioctl'.
Eric Blake 80cb44fa 2009-07-21T09:00:57 dup2: fix more mingw problems * lib/dup2.c (rpl_dup2) [_WIN32]: Avoid hanging when duplicating fd to itself. * doc/posix-functions/dup2.texi (dup2): Document the bug. * lib/unistd.in.h (dup2) [REPLACE_FCHDIR]: Avoid name collision. * lib/fchdir.c (dup2): Manage preprocessor macros correctly. (rpl_dup2_fchdir): Rename from rpl_dup2, and let dup2 module take care of mingw bugs. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake ddd625dd 2009-07-21T06:48:26 dup2: work around mingw and cygwin 1.5 bug * m4/dup2.m4 (gl_FUNC_DUP2): Detect mingw bug. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add witness. * modules/unistd (Makefile.am): Substitute it. * lib/unistd.in.h (dup2): Declare the replacement. * lib/dup2.c (dup2) [REPLACE_DUP2]: Implement it. * doc/posix-functions/dup2.texi (dup2): Document the bugs. * lib/fchdir.c (rpl_dup2): Don't collide with mingw replacement. * modules/execute (Depends-on): Add dup2. * modules/fseterr (Depends-on): Likewise. * modules/pipe (Depends-on): Likewise. * modules/posix_spawn-internal (Depends-on): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible d9576a55 2009-03-23T23:52:01 Remove dependency from 'close' module to -lws2_32 on native Windows.
Eric Blake ae5dae6f 2009-01-19T09:27:47 unistd: guarantee STDIN_FILENO here, for OS/2 EMX * lib/unistd.in.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Guarantee a definition. * doc/posix-headers/unistd.texi (unistd.h): Document the bug. * modules/unistd-safer (Depends-on): Add dependency on unistd. * lib/c-stack.c (STDERR_FILENO): Rely on <unistd.h>. * lib/dup-safer.c (STDERR_FILENO): Likewise. * lib/execute.c (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Likewise. * lib/fd-safer.c (STDIN_FILENO, STDERR_FILENO): Likewise. * lib/fopen-safer.c (STDERR_FILENO): Likewise. * lib/pipe.c (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Likewise. * lib/tmpfile-safer.c (STDERR_FILENO): Likewise. * tests/test-posix_spawn1.c (STDIN_FILENO, STDOUT_FILENO) (STDERR_FILENO): Likewise. * tests/test-posix_spawn2.c (STDIN_FILENO, STDOUT_FILENO) (STDERR_FILENO): Likewise. * tests/test-posix_spawn3.c (STDIN_FILENO, STDOUT_FILENO) (STDERR_FILENO): Likewise. Reported by Elbert Pol. Signed-off-by: Eric Blake <ebb9@byu.net>
Martin Lambers d1ed8a81 2009-01-18T19:28:53 New module 'link'.
Bruno Haible 7006c85f 2008-12-17T01:56:49 environ is supposed to be declared by <unistd.h>.
Bruno Haible 20491bb1 2008-10-25T23:13:43 Override the gethostname() declaration on native Windows systems.
Bruno Haible 719ff2a7 2008-10-25T22:48:11 Move HAVE__GL_CLOSE_FD_MAYBE_SOCKET macro.
Bruno Haible 655b30ed 2008-10-21T13:13:09 Add gethostname() declaration to <unistd.h>.
Bruno Haible e5e9d7f6 2008-10-19T13:07:15 Add getusershell(), setusershell(), endusershell() declarations to <unistd.h>.
Bruno Haible cded3d98 2008-10-19T12:43:15 Move the euidaccess() declaration to <unistd.h>.
Bruno Haible 977cc95f 2008-10-19T03:36:00 Move the getdomainname() declaration to <unistd.h>.
Bruno Haible 3c08dcc3 2008-10-18T02:43:18 Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Paolo Bonzini 59a539f3 2008-10-10T00:23:06 Combine the two replacements of 'close'.
Paolo Bonzini d638ad23 2008-10-10T00:06:58 New module 'close'.
Bruno Haible 6efcc54c 2008-10-05T16:51:07 New module 'getdtablesize'.
Richard W.M. Jones 9d7e96c8 2008-10-01T13:54:44 fsync: new module * lib/fsync.c: New file. * m4/fsync.m4: New file. * modules/fsync: New file. * modules/fsync-tests: New file. * tests/test-fsync.c: New file. * modules/unistd: Substitute GNULIB_FSYNC and HAVE_FSYNC. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Define and AC_SUBST both GNULIB_FSYNC and HAVE_FSYNC. * lib/unistd.in.h (@GNULIB_FSYNC@): Add a block for fsync. * MODULES.html.sh (posix_functions): Add fsync. * doc/posix-functions/fsync.texi: Update.
Bruno Haible 94b87393 2008-09-26T13:29:53 New module 'write'.
Bruno Haible c2318e88 2008-08-30T03:09:15 Avoid some "gcc -pedantic" warnings.
Bruno Haible 22eb7728 2008-02-24T16:40:15 New module 'environ'.
Martin Lambers e3e32d7b 2007-12-26T16:37:29 Override getpagesize on mingw.
Bruno Haible 2321bc21 2007-12-03T12:57:05 Move declaration of getpagesize() from getpagesize.h to unistd.h.
Bruno Haible f70369bf 2007-10-02T00:40:59 Rename unistd_.h to unistd.in.h.