1. 13 May, 2018 1 commit
    • Bruno Haible's avatar
      truncate: Fix compilation error on Android. · a0f15cb0
      Bruno Haible authored
      * m4/truncate.m4 (gl_FUNC_TRUNCATE): Test also whether 'truncate' is
      declared. Set HAVE_DECL_TRUNCATE, not HAVE_TRUNCATE.
      * lib/unistd.in.h (truncate): Test HAVE_DECL_TRUNCATE, not
      HAVE_TRUNCATE.
      * modules/truncate: Likewise.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_TRUNCATE,
      not HAVE_TRUNCATE.
      * modules/unistd (Makefile.am): Substitute HAVE_DECL_TRUNCATE, not
      HAVE_TRUNCATE.
      * doc/posix-functions/truncate.texi: Mention the issue.
      a0f15cb0
  2. 03 May, 2018 1 commit
    • Bruno Haible's avatar
      Simplify code. Drop support for Borland C++ on Windows. · 44b65c48
      Bruno Haible authored
      Reported by Gisle Vanem <gisle.vanem@gmail.com>.
      
      * lib/accept4.c: Simplify 'defined _WIN32 || defined __WIN32__' to just
      'defined _WIN32'.
      * lib/canonicalize-lgpl.c: Likewise.
      * lib/classpath.c: Likewise.
      * lib/clean-temp.c: Likewise.
      * lib/csharpexec.c: Likewise.
      * lib/ctime.c: Likewise.
      * lib/dosname.h: Likewise.
      * lib/dup2.c: Likewise.
      * lib/errno.in.h: Likewise.
      * lib/error.c: Likewise.
      * lib/euidaccess.c: Likewise.
      * lib/execute.c: Likewise.
      * lib/fcntl.in.h: Likewise.
      * lib/fcntl.c: Likewise.
      * lib/filename.h: Likewise.
      * lib/findprog.c: Likewise.
      * lib/flock.c: Likewise.
      * lib/fopen.c: Likewise.
      * lib/freopen.c: Likewise.
      * lib/fstat.c: Likewise.
      * lib/fsync.c: Likewise.
      * lib/gc-gnulib.c: Likewise.
      * lib/get-rusage-data.c: Likewise.
      * lib/getaddrinfo.c: Likewise.
      * lib/getdelim.c: Likewise.
      * lib/getdtablesize.c: Likewise.
      * lib/gethostname.c: Likewise.
      * lib/getlogin.c: Likewise.
      * lib/getlogin_r.c: Likewise.
      * lib/getopt.c: Likewise.
      * lib/getpagesize.c: Likewise.
      * lib/getpass.c: Likewise.
      * lib/getrusage.c: Likewise.
      * lib/gettimeofday.c: Likewise.
      * lib/glob.c: Likewise.
      * lib/inttypes.in.h: Likewise.
      * lib/isapipe.c: Likewise.
      * lib/javaexec.c: Likewise.
      * lib/link.c: Likewise.
      * lib/localcharset.c: Likewise.
      * lib/localename.h: Likewise.
      * lib/localename.c: Likewise.
      * lib/localtime.c: Likewise.
      * lib/lseek.c: Likewise.
      * lib/mbsinit.c: Likewise.
      * lib/mkdir.c: Likewise.
      * lib/msvc-nothrow.h: Likewise.
      * lib/nanosleep.c: Likewise.
      * lib/nl_langinfo.c: Likewise.
      * lib/nonblocking.c: Likewise.
      * lib/nproc.c: Likewise.
      * lib/open.c: Likewise.
      * lib/openpty.c: Likewise.
      * lib/pathmax.h: Likewise.
      * lib/pipe-filter-aux.c: Likewise.
      * lib/pipe-filter-gi.c: Likewise.
      * lib/pipe-filter-ii.c: Likewise.
      * lib/pipe.c: Likewise.
      * lib/pipe2.c: Likewise.
      * lib/poll.c: Likewise.
      * lib/popen.c: Likewise.
      * lib/posix_openpt.c: Likewise.
      * lib/printf-parse.c: Likewise.
      * lib/progreloc.c: Likewise.
      * lib/putenv.c: Likewise.
      * lib/read.c: Likewise.
      * lib/relocatable.c: Likewise.
      * lib/rename.c: Likewise.
      * lib/same-inode.h: Likewise.
      * lib/secure_getenv.c: Likewise.
      * lib/select.c: Likewise.
      * lib/sethostname.c: Likewise.
      * lib/setlocale.c: Likewise.
      * lib/sigaction.c: Likewise.
      * lib/sigprocmask.c: Likewise.
      * lib/sleep.c: Likewise.
      * lib/spawn-pipe.h: Likewise.
      * lib/spawn-pipe.c: Likewise.
      * lib/spawni.c: Likewise.
      * lib/stat-time.h: Likewise.
      * lib/stat-w32.c: Likewise.
      * lib/stat.c: Likewise.
      * lib/stdio.in.h: Likewise.
      * lib/stdio-impl.h: Likewise.
      * lib/stdio-read.c: Likewise.
      * lib/stdio-write.c: Likewise.
      * lib/stdlib.in.h: Likewise.
      * lib/strerror_r.c: Likewise.
      * lib/strftime-fixes.c: Likewise.
      * lib/sys_stat.in.h: Likewise.
      * lib/sys_types.in.h: Likewise.
      * lib/sys_wait.in.h : Likewise.
      * lib/system-quote.h: Likewise.
      * lib/system-quote.c: Likewise.
      * lib/tmpdir.c: Likewise.
      * lib/tzset.c: Likewise.
      * lib/uname.c: Likewise.
      * lib/unistd.in.h: Likewise.
      * lib/utime.in.h: Likewise.
      * lib/utime.c: Likewise.
      * lib/utimecmp.c: Likewise.
      * lib/utimens.c: Likewise.
      * lib/vasnprintf.c: Likewise.
      * lib/vma-iter.h: Likewise.
      * lib/vma-iter.c: Likewise.
      * lib/wait-process.c: Likewise.
      * lib/wcsftime.c: Likewise.
      * lib/wctype.in.h: Likewise.
      * lib/write.c: Likewise.
      * tests/nap.h: Likewise.
      * tests/test-cloexec.c: Likewise.
      * tests/test-dup-safer.c: Likewise.
      * tests/test-dup2.c: Likewise.
      * tests/test-dup3.c: Likewise.
      * tests/test-fcntl.c: Likewise.
      * tests/test-get-rusage-data.c: Likewise.
      * tests/test-getaddrinfo.c: Likewise.
      * tests/test-getlogin.h: Likewise.
      * tests/test-isatty.c: Likewise.
      * tests/test-localename.c: Likewise.
      * tests/test-mbrtowc-w32.c: Likewise.
      * tests/test-nonblocking.c: Likewise.
      * tests/test-nonblocking-pipe-main.c: Likewise.
      * tests/test-nonblocking-socket-main.c: Likewise.
      * tests/test-nonblocking-socket.h: Likewise.
      * tests/test-pipe.c: Likewise.
      * tests/test-pipe2.c: Likewise.
      * tests/test-poll.c: Likewise.
      * tests/test-pthread_sigmask1.c: Likewise.
      * tests/test-select.h: Likewise.
      * tests/test-sethostname2.c: Likewise.
      * tests/test-sigprocmask.c: Likewise.
      * tests/test-spawn-pipe-child.c: Likewise.
      * tests/test-stat-time.c: Likewise.
      * tests/test-system-quote-main.c: Likewise.
      * tests/test-utimens-common.h: Likewise.
      * tests/test-wcrtomb-w32.c: Likewise.
      * m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise.
      * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise.
      * m4/javacomp.m4 (gt_JAVACOMP): Likewise.
      * m4/javaexec.m4 (gt_JAVAEXEC): Likewise.
      * m4/locale-ar.m4 (gt_LOCALE_AR): Likewise.
      * m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise.
      * m4/locale-ja.m4 (gt_LOCALE_JA): Likewise.
      * m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise.
      * m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.
      * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Likewise.
      * m4/nocrash.m4 (GL_NOCRASH): Likewise.
      * m4/pathmax.m4 (gl_PATHMAX_SNIPPET): Likewise.
      * m4/ptsname_r.m4 (gl_PREREQ_PTSNAME_R): Likewise.
      * m4/stdio_h.m4 (gl_STDIO_H): Likewise.
      * m4/tmpfile.m4 (gl_FUNC_TMPFILE): Likewise.
      * m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
      44b65c48
  3. 01 Jan, 2018 1 commit
  4. 12 Nov, 2017 1 commit
    • Paul Eggert's avatar
      faccessat: port to macOS (Bug#29231) · dd1890b7
      Paul Eggert authored
      macOS faccessat has the same bug that lstat does: if the file
      name ends in '/' it ignores the trailing slash.
      Problem reported for Emacs by Vincent Zhang.
      * doc/posix-functions/faccessat.texi (faccessat): Document this.
      * lib/faccessat.c (_GL_INCLUDING_UNISTD_H): Define and undef
      around the initial includes.  Include errno.h, string.h, sys/stat.h.
      (orig_faccessat) [HAVE_FACCESSAT]: New function.
      Include "unistd.h" after defining it.
      (rpl_faccessat) [HAVE_FACCESSAT]: New implementation.
      * lib/unistd.in.h (faccessat) [REPLACE_FACCESSAT]:
      Handle in the usual way.
      * m4/faccessat.m4 (gl_FUNC_FACCESSAT): Replace faccessat if
      lstat dereferences symlinks, since faccessat is likely to
      have the same problem.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Default REPLACE_ACCESSAT.
      * modules/faccessat (Depends-on): Add fstatat.
      Depend if REPLACE_FACCESSAT is 1, too.
      (configure.ac): Link if REPLACE_FACCESSAT is 1.
      * modules/faccessat-tests (Depends-on): Add symlink.
      * modules/unistd (unistd.h): Substitute REPLACE_FACCESSAT.
      * tests/test-faccessat.c (main): Test for the bug.
      dd1890b7
  5. 13 May, 2017 1 commit
    • Bruno Haible's avatar
      truncate: New module. · f4d71054
      Bruno Haible authored
      * lib/unistd.in.h (truncate): New declaration.
      * lib/truncate.c: New file.
      * m4/truncate.m4: New file.
      * m4/unistd_h.m4 (gl_UNISTD_H): Test whether 'truncate' is declared.
      (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_TRUNCATE, HAVE_TRUNCATE,
      REPLACE_TRUNCATE.
      * modules/unistd (Makefile.am): Substitute GNULIB_TRUNCATE,
      HAVE_TRUNCATE, REPLACE_TRUNCATE.
      * modules/truncate: New file.
      * tests/test-unistd-c++.cc (truncate): Test signature.
      * doc/posix-functions/truncate.texi: Mention the new module.
      f4d71054
  6. 01 Jan, 2017 1 commit
    • Paul Eggert's avatar
      version-etc: new year · a3fd683d
      Paul Eggert authored
      * 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'.
      a3fd683d
  7. 17 Dec, 2016 1 commit
    • Bruno Haible's avatar
      getlogin: Port to newer mingw. · 8fe9cd1c
      Bruno Haible authored
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_GETLOGIN.
      * m4/getlogin.m4 (gl_FUNC_GETLOGIN): Set HAVE_DECL_GETLOGIN.
      * modules/unistd (Makefile.am): Substibute HAVE_DECL_GETLOGIN, not
      HAVE_GETLOGIN.
      * lib/unistd.in.h (getlogin): Test HAVE_DECL_GETLOGIN, not
      HAVE_GETLOGIN.
      * doc/posix-functions/getlogin.texi: Mention the issue.
      * tests/test-getlogin.c: Don't include <pwd.h> on native Windows.
      8fe9cd1c
  8. 01 Jan, 2016 1 commit
    • Paul Eggert's avatar
      version-etc: new year · 71090a2a
      Paul Eggert authored
      * 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'.
      71090a2a
  9. 01 Jan, 2015 1 commit
    • Paul Eggert's avatar
      version-etc: new year · b9bfe784
      Paul Eggert authored
      * doc/gnulib.texi:
      * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date.
      * all files: Run 'make update-copyright'.
      b9bfe784
  10. 19 Oct, 2014 2 commits
    • Paul Eggert's avatar
      symlinkat: port to AIX 7.1 · 032bd151
      Paul Eggert authored
      * doc/posix-functions/symlinkat.texi (symlinkat):
      Mention AIX porting problem.
      * lib/symlinkat.c: Always include errno.h.
      (rpl_symlinkat) [HAVE_SYMLINKAT]: New function.
      * lib/unistd.in.h (symlinkat): Add replacement machinery.
      * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Check symlinkat behavior.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add REPLACE_SYMLINKAT.
      * modules/symlinkat (Depends-on): Add fstatat if REPLACE_SYMLINKAT.
      (configure.ac): Also compile replacement if REPLACE_SYMLINKAT.
      * modules/unistd (unistd.h): Substitute REPLACE_SYMLINKAT.
      032bd151
    • Paul Eggert's avatar
      readlinkat: port to AIX 7.1 · cb3a9b8b
      Paul Eggert authored
      * doc/posix-functions/readlink.texi (readlink):
      * doc/posix-functions/readlinkat.texi (readlinkat):
      Mention AIX porting problem.
      * lib/readlinkat.c (rpl_readlinkat) [HAVE_READLINKAT]:
      New function.
      * lib/unistd.in.h (readlinkat): Add replacement machinery.
      * m4/readlinkat.m4 (gl_FUNC_READLINKAT): Check readlinkat signature.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add REPLACE_READLINKAT.
      * modules/readlinkat (configure.ac): Also compile replacement
      if REPLACE_READLINKAT.
      * modules/unistd (unistd.h): Substitute REPLACE_READLINKAT.
      cb3a9b8b
  11. 01 Jan, 2014 1 commit
  12. 26 Sep, 2013 1 commit
    • Eric Blake's avatar
      getdtablesize: work around cygwin issue · 3bd0d48d
      Eric Blake authored
      Cygwin 1.7.25 has a bug that even though it claims to support
      RLIMIT_NOFILE inheritance, there is no enforcement of the soft
      limit, and getdtablesize() automatically grows until it reaches
      the hard limit which cannot be changed by setrlimit().  Best is
      to just treat things as an invariant limit, as several other
      modules assume that getdtablesize() will not change without an
      intervening setrlimit().
      
      * m4/getdtablesize.m4 (gl_FUNC_GETDTABLESIZE): Detect problem.
      * modules/getdtablesize (configure.ac): Build replacement.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set up a witness.
      * modules/unistd (Makefile.am): Expose the witness.
      * lib/unistd.in.h (getdtablesize): Declare replacement.
      * lib/getdtablesize.c (rpl_getdtablesize): Work around it.
      * tests/test-getdtablesize.c (main): Test it.
      * doc/glibc-functions/getdtablesize.texi (getdtablesize): Document it.
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
      3bd0d48d
  13. 01 Jan, 2013 1 commit
  14. 30 Nov, 2012 1 commit
    • Paul Eggert's avatar
      unistd: better 'inline' · 108828a0
      Paul Eggert authored
      * lib/unistd.c: New file.
      * lib/unistd.in.h (_GL_UNISTD_INLINE):
      New macro.  Replace all uses of 'static inline' with it.
      Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
      * m4/unistd_h.m4 (gl_UNISTD_H): Do not require AC_C_INLINE.
      * modules/unistd (Files, lib_SOURCES): Add lib/unistd.c.
      (Depends-on): Add extern-inline.
      108828a0
  15. 04 May, 2012 2 commits
    • Bruno Haible's avatar
      Tweak last commit. · fe809107
      Bruno Haible authored
      * m4/off_t.m4 (gl_TYPE_OFF_T): Tweak comments.
      * m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
      fe809107
    • Paul Eggert's avatar
      unistd_h: make it easier to avoid sys_types_h · 0918b47b
      Paul Eggert authored
      This is useful for Emacs, which has its own method of porting to
      Windows, and which therefore does not need the sys_types_h module.
      * m4/off_t.m4: New file, defining gl_TYPE_OFF_T, which contains
      code moved here from gl_SYS_TYPES_H.
      * m4/sys_types_h.m4 (gl_SYS_TYPES_H): Require it instead of
      using the code directly.
      * m4/unistd_h.m4 (gl_UNISTD_H): Require gl_TYPE_OFF_T, not
      gl_SYS_TYPES_H.
      * modules/sys_types (Files):
      * modules/unistd (Files): Add m4/off_t.m4.
      0918b47b
  16. 21 Apr, 2012 1 commit
    • Bruno Haible's avatar
      Large File Support for native Windows platforms. · 3f3d9b41
      Bruno Haible authored
      * m4/largefile.m4 (gl_LARGEFILE): New macro.
      * modules/largefile (configure.ac): Require gl_LARGEFILE.
      
      * lib/sys_types.in.h (off_t) [WINDOWS_64_BIT_OFF_T]: Define to a 64-bit
      type.
      * m4/sys_types_h.m4 (gl_SYS_TYPES_H): Set WINDOWS_64_BIT_OFF_T.
      * modules/sys_types (Makefile.am): Substitute WINDOWS_64_BIT_OFF_T.
      * doc/posix-headers/sys_types.texi: Mention the effect of the
      'largefile' module.
      
      * lib/fcntl.in.h: Add comments about off_t.
      * modules/fcntl-h (Depends-on): Add sys_types.
      
      * lib/unistd.in.h [WINDOWS_64_BIT_OFF_T]: Include <sys/types.h>.
      (ftruncate): Replace it if REPLACE_FTRUNCATE is 1.
      * m4/unistd_h.m4 (gl_UNISTD_H): Require gl_SYS_TYPES_H.
      (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_FTRUNCATE.
      * modules/unistd (Depends-on): Add sys_types.
      (Makefile.am): Substitute WINDOWS_64_BIT_OFF_T, REPLACE_FTRUNCATE.
      
      * lib/lseek.c (rpl_lseek) [_GL_WINDOWS_64_BIT_OFF_T]: Use _lseeki64
      instead of lseek.
      * m4/lseek.m4 (gl_FUNC_LSEEK): Require gl_SYS_TYPES_H. Set
      REPLACE_LSEEK if WINDOWS_64_BIT_OFF_T is 1.
      * modules/lseek (Depends-on): Add sys_types.
      
      * lib/ftruncate.c: Put under GPLv3+. Include <windows.h>,
      msvc-nothrow.h.
      (SetFileSize): New function.
      (ftruncate) [_GL_WINDOWS_64_BIT_OFF_T]: New implementation.
      * m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Set REPLACE_FTRUNCATE on Windows
      if Large File Support is requested.
      * modules/ftruncate (configure.ac): Consider REPLACE_FTRUNCATE.
      (Depends-on): Add sys_types, msvc-nothrow. Update conditions.
      
      * lib/stdio.in.h: Add comments about off_t.
      * modules/stdio (Depends-on): Add sys_types.
      
      * lib/ftello.c [_GL_WINDOWS_64_BIT_OFF_T]: Use _ftelli64 or ftello64
      instead of ftello.
      * m4/ftello.m4 (gl_FUNC_FTELLO): Require gl_SYS_TYPES_H. Set
      REPLACE_FTELLO if WINDOWS_64_BIT_OFF_T is 1.
      (gl_PREREQ_FTELLO): New macro.
      * modules/ftello (Depends-on): Add sys_types.
      (configure.ac): Incoke gl_PREREQ_FTELLO.
      
      * lib/fseeko.c [_GL_WINDOWS_64_BIT_OFF_T]: Use _fseeki64 or fseeko64
      instead of fseeko.
      * m4/fseeko.m4 (gl_FUNC_FSEEKO): Require gl_SYS_TYPES_H. Set
      REPLACE_FSEEKO if WINDOWS_64_BIT_OFF_T is 1.
      (gl_PREREQ_FSEEKO): New macro.
      * modules/fseeko (Depends-on): Add sys_types.
      (configure.ac): Invoke gl_PREREQ_FSEEKO.
      
      * lib/sys_stat.in.h: Add comments about off_t.
      (stat, fstat) [WINDOWS_64_BIT_ST_SIZE]: Define to variants that use a
      64-bit integer for st_size in 'struct stat'.
      * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Set WINDOWS_64_BIT_ST_SIZE.
      Define _GL_WINDOWS_64_BIT_ST_SIZE.
      * modules/sys_stat (Depends-on): Add sys_types.
      (Makefile.am): Substitute WINDOWS_64_BIT_ST_SIZE.
      
      * lib/stat.c (stat) [_GL_WINDOWS_64_BIT_ST_SIZE]: Define to _stati64
      instead of stat or _stat.
      
      * lib/fstat.c [_GL_WINDOWS_64_BIT_ST_SIZE]: Use _fstati64 and
      'struct _stati64' instead of fstat and 'struct stat'.
      * m4/fstat.m4 (gl_FUNC_FSTAT): Require gl_HEADER_SYS_STAT_H. Set
      REPLACE_FSTAT if WINDOWS_64_BIT_ST_SIZE is 1.
      
      Reported by Ray Satiro <raysatiro@yahoo.com>.
      3f3d9b41
  17. 03 Jan, 2012 1 commit
    • Bruno Haible's avatar
      New module 'isatty'. · d7af94ea
      Bruno Haible authored
      * lib/unistd.in.h (isatty): New declaration.
      * lib/isatty.c: New file, based on an idea of
      Bastien Roucariès <roucaries.bastien@gmail.com>.
      * m4/isatty.m4: New file.
      * m4/unistd_h.m4 (gl_UNISTD_H): Test whether isatty is declared.
      (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_ISATTY, REPLACE_ISATTY.
      * modules/unistd (Makefile.am): Substitute GNULIB_ISATTY,
      REPLACE_ISATTY.
      * modules/isatty: New file.
      * doc/posix-functions/isatty.texi: Mention the new module.
      Suggested by Paolo Bonzini.
      d7af94ea
  18. 01 Jan, 2012 1 commit
  19. 03 Dec, 2011 2 commits
    • Bruno Haible's avatar
      Tweak last commit. · cea318a9
      Bruno Haible authored
      * lib/unistd.in.h (sethostname): Keep declarations in alphabetic order.
      Fix preprocessor directives indentation. Fix typos.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Keep alphabetic order.
      * modules/unistd (Makefile): Likewise.
      cea318a9
    • Ben Walton's avatar
      Integrate the sethostname module into unistd · 0ce62ceb
      Ben Walton authored
      Ensure that sethostname is accounted for within the unistd module.
      
      * lib/unistd.in.h: Integrate the SETHOSTNAME preprocessor handling
      into the unistd.h header.
      * m4/unistd_h.m4: Setup the autoconf handling for the SETHOSTNAME
      preprocessor directives.
      * modules/unistd: Setup the Makefile substitutions of the
      SETHOSTNAME preprocessor directives.
      Signed-off-by: 's avatarBen Walton <bwalton@artsci.utoronto.ca>
      0ce62ceb
  20. 26 Nov, 2011 1 commit
    • Bruno Haible's avatar
      Fix conflict between two instantiations of module 'unistd'. · 48bf98f3
      Bruno Haible authored
      * gnulib-tool (func_emit_autoconf_snippet): Substitute
      ${include_guard_prefix} also in the autoconf snippet.
      * m4/getopt.m4 (gl_FUNC_GETOPT_POSIX): Don't set GNULIB_UNISTD_H_GETOPT.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Don't initialize
      GNULIB_UNISTD_H_GETOPT.
      * modules/getopt-posix (configure.ac): Set the
      GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT variable.
      * modules/getopt-gnu (configure.ac): Likewise.
      * modules/unistd (Makefile.am): Change the substitution value of
      GNULIB_UNISTD_H_GETOPT to depend on the include guard prefix.
      Reported by Simon Josefsson.
      48bf98f3
  21. 24 Sep, 2011 1 commit
    • Bruno Haible's avatar
      New module 'dup'. · 4810e2dc
      Bruno Haible authored
      * lib/unistd.in.h (dup): Declare only if the 'dup' module is in use.
      Allow replacement.
      * lib/dup.c: New file.
      * lib/fchdir.c (rpl_dup): Remove function.
      * m4/dup.m4: New file.
      * m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't set REPLACE_DUP here.
      * m4/unistd_h.m4 (gl_UNISTD_H): Test whether 'dup' is declared.
      (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_DUP.
      * modules/unistd (Makefile.am): Substitute GNULIB_DUP.
      * modules/dup: New file.
      * tests/test-unistd-c++.cc: Check the signature of 'dup' only if the
      'dup' module is in use.
      * modules/fdopendir (Depends-on): Add dup.
      * modules/fdutimensat-tests (Depends-on): Likewise.
      * modules/fts (Depends-on): Likewise.
      * modules/futimens-tests (Depends-on): Likewise.
      * modules/posix_spawnp-tests (Depends-on): Likewise.
      * modules/unistd-safer-tests (Depends-on): Likewise.
      * modules/utimens-tests (Depends-on): Likewise.
      * doc/posix-functions/dup.texi: Mention the new module and the problem
      on MSVC.
      4810e2dc
  22. 23 Sep, 2011 1 commit
    • Bruno Haible's avatar
      New module 'chdir'. · 0d22381b
      Bruno Haible authored
      * modules/chdir: New file.
      * lib/unistd.in.h: Include <io.h>, <direct.h> also for chdir.
      (chdir): New declaration.
      * m4/unistd_h.m4 (gl_UNISTD_H): Test whether chdir is declared.
      (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_CHDIR.
      * modules/unistd (Makefile.am): Substitute GNULIB_CHDIR.
      * tests/test-unistd-c++.cc: Check signature of chdir.
      * doc/posix-functions/chdir.texi: Mention problem on native Windows.
      * modules/chdir-long (Depends-on): Add chdir.
      * modules/fchdir (Depends-on): Likewise.
      * modules/rename (Depends-on): Likewise.
      * modules/savewd (Depends-on): Likewise.
      0d22381b
  23. 16 Sep, 2011 2 commits
    • Eric Blake's avatar
      fdatasync: port to MacOS X 10.7 · c14a71ce
      Eric Blake authored
      MacOS X 10.7 added an fdatasync syscall and exports a symbol for it,
      but fails to declare it anywhere.  Lacking any hard evidence that this
      syscall is broken, we will just provide the declaration and use it.
      
      * m4/fdatasync.m4 (gl_FUNC_FDATASYNC): Check for present but not
      declared.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Another default.
      * modules/unistd (Makefile.am): Substitute it.
      * lib/unistd.in.h (fdatasync): Declare on MacOS.
      * doc/posix-functions/fdatasync.texi (fdatasync): Document it.
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
      c14a71ce
    • Eric Blake's avatar
      fdatasync: new module · 64da7b6c
      Eric Blake authored
      At least libvirt would like to use the lighter-weight fdatasync
      on platforms where it is supported, while still guaranteeing full
      sync (via the heavy-weight fsync fallback) on all platforms.
      
      I've got an open question to the Austin Group, since the POSIX 2008
      wording is self-contradictory (unlike fsync, fdatasync requires
      EBADF on non-writable fds, but still mentions that read() errors
      must be propagated).  I can see how fsync() would affect atime after
      read() while fdatasync() can skip that, explaining why fdatasync()
      might have the EBADF requirement, but on the other hand, that prevents
      an implementation (like ours) where fdatasync is a straight alias of
      fsync.  At any rate, glibc allows fdatasync on read-only fds.
      
      * modules/fsync (Description): Document difference to fdatasync.
      * modules/fdatasync: New module.
      * m4/fdatasync.m4 (gl_FUNC_FDATASYNC): New file.
      * lib/fdatasync.c (fdatasync): Likewise.
      * m4/unistd_h.m4 (gl_UNISTD_H, gl_UNISTD_H_DEFAULTS): Set up
      defaults.
      * modules/unistd (Makefile.am): Set witnesses.
      * lib/unistd.in.h (fdatasync): Declare.
      * MODULES.html.sh: Document it.
      * doc/posix-functions/fdatasync.texi (fdatasync): Likewise.
      * modules/fdatasync-tests: New test.
      * tests/test-fdatasync.c: Likewise.
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
      64da7b6c
  24. 11 Sep, 2011 2 commits
    • Bruno Haible's avatar
      unistd et al.: Don't assume <unistd.h> exists. · 912da04e
      Bruno Haible authored
      * m4/chdir-long.m4 (gl_FUNC_CHDIR_LONG): Don't include <unistd.h> if it
      does not exist.
      * m4/environ.m4 (gl_ENVIRON): Don't include <unistd.h> if it does not
      exist. But include <stdlib.h>.
      * m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): If <unistd.h> does not exist,
      include <io.h> and <stdlib.h> instead. Don't test symbolink links if
      symlink() does not exist.
      * m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): If <unistd.h> does not exist,
      include <io.h> instead.
      * m4/free.m4 (gl_FUNC_FREE): Assume free(NULL) works on native Windows.
      * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): If <unistd.h> does not exist,
      include <direct.h> instead.
      * m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Likewise.
      * m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
      * m4/lseek.m4 (gl_FUNC_LSEEK): If <unistd.h> does not exist, include
      <io.h> instead.
      * m4/rename.m4 (gl_FUNC_RENAME): Assume rename() manages hard links
      correctly if the system does not have hard links.
      * m4/rmdir.m4 (gl_FUNC_RMDIR): If <unistd.h> does not exist, include
      <direct.h> instead.
      * m4/unistd_h.m4 (gl_UNISTD_H): If <unistd.h> does not exist, bypass
      it when looking for function declarations.
      * m4/unlink.m4 (gl_FUNC_UNLINK): If <unistd.h> does not exist, include
      <direct.h> and <io.h> instead.
      * doc/posix-headers/unistd.texi: More details about MSVC problem.
      912da04e
    • Bruno Haible's avatar
      Ensure pid_t gets defined. · 0b88a15d
      Bruno Haible authored
      * m4/fcntl_h.m4 (gl_FCNTL_H): Require AC_TYPE_PID_T.
      * m4/sched_h.m4 (gl_SCHED_H): Likewise.
      * m4/signal_h.m4 (gl_SIGNAL_H): Likewise.
      * m4/spawn_h.m4 (gl_SPAWN_H): Likewise.
      * m4/sys_wait_h.m4 (gl_SYS_WAIT_H): Likewise.
      * m4/termios_h.m4 (gl_TERMIOS_H): Likewise.
      * m4/time_h.m4 (gl_HEADER_TIME_H_BODY): Likewise.
      * m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
      * tests/test-fcntl-h.c: Check that pid_t is defined.
      * tests/test-sched.c: Likewise.
      * tests/test-termios.c: Likewise.
      * tests/test-time.c: Likewise.
      * doc/posix-headers/fcntl.texi: Mention lack of pid_t on MSVC platform.
      * doc/posix-headers/signal.texi: Likewise.
      * doc/posix-headers/sys_types.texi: Likewise.
      * doc/posix-headers/time.texi: Likewise.
      0b88a15d
  25. 12 May, 2011 1 commit
    • Bruno Haible's avatar
      group-member: Declare function in <unistd.h>. · fae7fdcf
      Bruno Haible authored
      * lib/unistd.in.h (group_member): New declaration.
      * lib/group-member.h: Remove file.
      * lib/group-member.c: Include <unistd.h> instead of group-member.h.
      * tests/test-unistd-c++.cc: Check signature of group_member.
      * m4/group-member.m4 (gl_FUNC_GROUP_MEMBER): Require
      gl_UNISTD_H_DEFAULTS. Set HAVE_GROUP_MEMBER.
      * m4/unistd_h.m4 (gl_UNISTD_H): Check whether group_member is declared.
      (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GROUP_MEMBER,
      HAVE_GROUP_MEMBER.
      * modules/group-member (Files): Remove lib/group-member.h.
      (Depends-on): Add unistd. Specify conditions.
      (configure.ac): Invoke gl_UNISTD_MODULE_INDICATOR.
      (Include): Change to <unistd.h>.
      * modules/unistd (Makefile.am): Substitute GNULIB_GROUP_MEMBER,
      HAVE_GROUP_MEMBER.
      * NEWS: Mention the change.
      * lib/euidaccess.c: Don't include group-member.h.
      fae7fdcf
  26. 14 Apr, 2011 1 commit
    • Bruno Haible's avatar
      Support non-blocking pipe I/O in read() on native Windows. · acc203f3
      Bruno Haible authored
      * lib/unistd.in.h: Include <sys/types.h> also for 'read'.
      (read): New declaration.
      * lib/read.c: New file.
      * lib/stdio.in.h (_GL_ATTRIBUTE_FORMAT_SCANF,
      _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM): New macros.
      (fgetc, fgets, fread, fscanf, getc, getchar, gets, scanf, vfscanf,
      vscanf): New declarations.
      * lib/stdio-read.c: New file.
      * m4/read.m4: New file.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_READ,
      REPLACE_READ.
      * m4/stdio_h.m4 (gl_STDIO_H): Set GNULIB_FGETC, GNULIB_FGETS,
      GNULIB_FREAD, GNULIB_FSCANF, GNULIB_GETC, GNULIB_GETCHAR, GNULIB_GETS,
      GNULIB_SCANF, GNULIB_VFSCANF, GNULIB_VSCANF. In non-blocking I/O is
      desired and needs workarounds, set REPLACE_STDIO_READ_FUNCS.
      (gl_STDIO_H_DEFAULTS): Initialize GNULIB_FGETC, GNULIB_FGETS,
      GNULIB_FREAD, GNULIB_FSCANF, GNULIB_GETC, GNULIB_GETCHAR, GNULIB_GETS,
      GNULIB_SCANF, GNULIB_VFSCANF, GNULIB_VSCANF, REPLACE_STDIO_READ_FUNCS.
      * modules/read: New file.
      * modules/nonblocking (Files): Add lib/stdio-read.c.
      * modules/unistd (Makefile.am): Substitute GNULIB_READ, REPLACE_READ.
      * modules/stdio (Makefile.am): Substitute GNULIB_FGETC, GNULIB_FGETS,
      GNULIB_FREAD, GNULIB_FSCANF, GNULIB_GETC, GNULIB_GETCHAR, GNULIB_GETS,
      GNULIB_SCANF, GNULIB_VFSCANF, GNULIB_VSCANF, REPLACE_STDIO_READ_FUNCS.
      * modules/pread (Depends-on): Add read.
      * modules/safe-read (Depends-on): Likewise.
      * tests/test-stdio-c++.cc (fgetc, fgets, fread, fscanf, getc, getchar,
      gets, scanf, vfscanf, vscanf): Verify signatures.
      * doc/posix-functions/read.texi: Mention 'nonblocking' module and
      problem with non-blocking pipes.
      * doc/posix-functions/fgetc.texi: Likewise.
      * doc/posix-functions/fgets.texi: Likewise.
      * doc/posix-functions/fread.texi: Likewise.
      * doc/posix-functions/fscanf.texi: Likewise.
      * doc/posix-functions/getc.texi: Likewise.
      * doc/posix-functions/getchar.texi: Likewise.
      * doc/posix-functions/gets.texi: Likewise.
      * doc/posix-functions/scanf.texi: Likewise.
      * doc/posix-functions/vfscanf.texi: Likewise.
      * doc/posix-functions/vscanf.texi: Likewise.
      acc203f3
  27. 13 Apr, 2011 1 commit
    • Bruno Haible's avatar
      Support non-blocking pipe I/O in write() on native Windows. · 836e0457
      Bruno Haible authored
      * lib/unistd.in.h (write): Enable replacement also if
      GNULIB_UNISTD_H_NONBLOCKING is 1.
      * lib/write.c: Enable replacement also if GNULIB_NONBLOCKING.
      (rpl_write): When failing to write on a non-blocking pipe, change
      errno from ENOSPC to EAGAIN.
      * lib/stdio.in.h (fprintf, fputc, fputs, fwrite, printf, putc,
      putchar, puts, vfprintf, vprintf): Enable replacement also if
      GNULIB_STDIO_H_NONBLOCKING is 1.
      * lib/stdio-write.c: Enable replacements also if GNULIB_NONBLOCKING.
      (CLEAR_ERRNO, HANDLE_ENOSPC): New macros.
      (CLEAR_LastError, HANDLE_ERROR_NO_DATA): New macros, extracted from
      CALL_WITH_SIGPIPE_EMULATION.
      (CALL_WITH_SIGPIPE_EMULATION): Use them.
      * m4/nonblocking.m4: New file.
      * m4/write.m4 (gl_FUNC_WRITE): Enable REPLACE_WRITE also if required
      for non-blocking I/O support.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize
      GNULIB_UNISTD_H_NONBLOCKING.
      * m4/stdio_h.m4 (gl_STDIO_H): Enable REPLACE_STDIO_WRITE_FUNCS also if
      required for non-blocking I/O support.
      (gl_STDIO_H_DEFAULTS): Initialize GNULIB_STDIO_H_NONBLOCKING.
      * modules/nonblocking (Files): Add m4/nonblocking.m4,
      lib/stdio-write.c, m4/asm-underscore.m4.
      (Depends-on): Add stdio, unistd.
      (configure.ac): Invoke gl_NONBLOCKING_IO. Define GNULIB_NONBLOCKING.
      Set GNULIB_STDIO_H_NONBLOCKING, GNULIB_UNISTD_H_NONBLOCKING.
      * modules/unistd (Makefile.am): Substitute GNULIB_UNISTD_H_NONBLOCKING.
      * modules/stdio (Makefile.am): Substitute GNULIB_STDIO_H_NONBLOCKING.
      * doc/posix-functions/fprintf.texi: Mention 'nonblocking' module and
      problem with non-blocking pipes.
      * doc/posix-functions/fputc.texi: Likewise.
      * doc/posix-functions/fputs.texi: Likewise.
      * doc/posix-functions/fwrite.texi: Likewise.
      * doc/posix-functions/printf.texi: Likewise.
      * doc/posix-functions/putc.texi: Likewise.
      * doc/posix-functions/putchar.texi: Likewise.
      * doc/posix-functions/puts.texi: Likewise.
      * doc/posix-functions/vfprintf.texi: Likewise.
      * doc/posix-functions/vprintf.texi: Likewise.
      * doc/posix-functions/write.texi: Likewise.
      836e0457
  28. 21 Jan, 2011 1 commit
    • Paul Eggert's avatar
      gl_CHECK_NEXT_HEADERS implies AC_CHECK_HEADERS_ONCE · 8397b02d
      Paul Eggert authored
      * m4/include_next.m4 (gl_CHECK_HEXT_HEADERS): Document this.
      * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Don't bother to invoke
      AC_CHECK_HEADERS_ONCE on a header that we also invoke
      gl_CHECK_NEXT_HEADERS on, since the latter invokes the former.
      * m4/netdb_h.m4 (gl_HEADER_NETDB): Likewise.
      * m4/pthread.m4 (gl_PTHREAD_CHECK): Likewise.
      * m4/sched_h.m4 (gl_SCHED_H): Likewise.
      * m4/search_h.m4 (gl_SEARCH_H): Likewise.
      * m4/spawn_h.m4 (gl_SPAWN_H): Likewise.
      * m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H): Likewise.
      * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise.
      * m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise.
      * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise.
      * m4/termios_h.m4 (gl_TERMIOS_H): Likewise.
      * m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
      * m4/wchar_h.m4 (gl_WCHAR_H): Likewise.
      * m4/wctype_h.m4 (gl_WCTYPE_H): Likewise.
      8397b02d
  29. 01 Jan, 2011 1 commit
  30. 22 Dec, 2010 1 commit
    • Bruno Haible's avatar
      getlogin_r: Work around portability problem on OSF/1. · e53e23a0
      Bruno Haible authored
      * m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Detect the OSF/1 problem.
      * lib/unistd.in.h (getlogin_r): Replace if REPLACE_GETLOGIN_R is set.
      * lib/getlogin_r.c (getlogin_r): When getlogin_r exists, invoke it and
      test for a truncated result.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETLOGIN_R.
      * modules/unistd (Makefile.am): Substitute REPLACE_GETLOGIN_R.
      * modules/getlogin_r (Depends-on): Add memchr.
      * doc/posix-functions/getlogin_r.texi: Mention the OSF/1 problem.
      e53e23a0
  31. 20 Dec, 2010 1 commit
    • Bruno Haible's avatar
      ttyname_r: Add missing declaration on HP-UX 11. · 5ceff074
      Bruno Haible authored
      * lib/unistd.in.h (ttyname_r): Test HAVE_DECL_TTYNAME_R instead of
      HAVE_TTYNAME_R.
      * m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Test whether ttyname_r is
      declared. Set HAVE_TTYNAME_R always.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize
      HAVE_DECL_TTYNAME_R, not HAVE_TTYNAME_R.
      * modules/unistd (Makefile.am): Substitute HAVE_DECL_TTYNAME_R, not
      HAVE_TTYNAME_R.
      * doc/posix-functions/ttyname_r.texi: Document the HP-UX 11 problem.
      5ceff074
  32. 19 Dec, 2010 1 commit
    • Bruno Haible's avatar
      fchdir: Add missing declaration on OSF/1 5.1. · 2fac6f35
      Bruno Haible authored
      * lib/unistd.in.h (fchdir): Provide declaration if systems lacks it.
      * m4/fchdir.m4 (gl_FUNC_FCHDIR): Check whether fchdir is declared.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_FCHDIR.
      * modules/unistd (Makefile.am): Substitute HAVE_DECL_FCHDIR.
      * doc/posix-functions/fchdir.texi: Mention the OSF/1 5.1 problem.
      2fac6f35
  33. 11 Dec, 2010 1 commit
    • Bruno Haible's avatar
      pipe-posix: Make it work in C++ mode. · 1594aaea
      Bruno Haible authored
      * lib/unistd.in.h: Don't include <io.h>, <fcntl.h> for pipe.
      (pipe): Use common idiom, not a macro definition.
      * lib/pipe.c: New file.
      * m4/pipe.m4: New file.
      * modules/pipe-posix (Description): Enhance.
      (Files): Add lib/pipe.c, m4/pipe.m4.
      (configure.ac): Invoke gl_FUNC_PIPE.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_PIPE.
      * modules/unistd (Makefile.am): Substitute HAVE_PIPE.
      * tests/test-unistd-c++.cc: Check the signature of pipe.
      1594aaea
  34. 10 Dec, 2010 1 commit
    • Eric Blake's avatar
      pipe-posix: new module · e2f1471b
      Eric Blake authored
      * modules/pipe-posix: New file.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set default.
      (gl_UNISTD_H): Check for declaration.
      * modules/unistd (Makefile.am): Substitute it.
      * lib/unistd.in.h (pipe): Provide it for mingw.
      * doc/posix-functions/pipe.texi (pipe): Update documentation.
      * MODULES.html.sh (File descriptor based Input/Output): Likewise.
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
      e2f1471b
  35. 30 Nov, 2010 1 commit
    • Bruno Haible's avatar
      getdomainname: Use the system function when possible. · b4417f75
      Bruno Haible authored
      * lib/unistd.in.h: Include <netdb.h>, for getdomainname's declaration.
      (getdomainname): Replace if needed. Provide the declaration if it is
      missing. Don't use _GL_CXXALIAS_SYS_CAST.
      * lib/getdomainname.c: Include <limits.h> and <sys/systeminfo.h>.
      (getdomainname): When the system has getdomainname, call the system
      function. When sysinfo (SI_SRPC_DOMAIN, ...) is possible, use that.
      * m4/getdomainname.m4 (gl_FUNC_GETDOMAINNAME): Require
      gl_HEADER_SYS_SOCKET and gl_HEADER_NETDB. Test whether the function is
      found in libnsl. Look for the declaration also in <netdb.h>. Replace
      the function if its second argument is of type 'int' or if it is found
      in libnsl.
      (gl_PREREQ_GETDOMAINNAME): Define HAVE_GETDOMAINNAME. Check for
      <sys/systeminfo.h> and sysinfo().
      * modules/getdomainname (Depends-on): Add netdb, sys_socket.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize
      HAVE_DECL_GETDOMAINNAME and REPLACE_GETDOMAINNAME instead of
      HAVE_GETDOMAINNAME.
      * modules/unistd (Makefile.am): Substitute HAVE_DECL_GETDOMAINNAME and
      REPLACE_GETDOMAINNAME instead of HAVE_GETDOMAINNAME.
      * doc/glibc-functions/getdomainname.texi: Document the problems with
      the getdomainname declaration.
      b4417f75