summaryrefslogtreecommitdiff
path: root/modules/unistd
Commit message (Collapse)AuthorAgeFilesLines
* copy-file-range: work around Linux kernel bugPaul Eggert2022-01-141-0/+1
| | | | | | | | | | | | | | | | This workaround is adapted from Coreutils. * lib/copy-file-range.c [__linux__ && HAVE_COPY_FILE_RANGE]: Include <sys/utsname.h>. (copy_file_range): Use a stub to replace the copy_file_range of Linux kernel versions 4.5 through 5.2. * lib/unistd.in.h (copy_file_range): * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): * modules/copy-file-range (configure.ac): * modules/unistd (unistd.h): Support replacement of copy_file_range. * m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE): Define HAVE_COPY_FILE_RANGE if the system has copy_file_range, and on Linux check whether the system’s is known to work.
* getpass-gnu: Allow use as dependency from test modules.Bruno Haible2022-01-031-0/+2
| | | | | | | | | | | | | | | | * m4/getpass.m4 (gl_FUNC_GETPASS_GNU): Set REPLACE_GETPASS_FOR_GETPASS_GNU instead of REPLACE_GETPASS. * m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Initialize the getpass-gnu module indicator. (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETPASS_FOR_GETPASS_GNU. * modules/unistd (Makefile.am): Substitute GNULIB_GETPASS_GNU, REPLACE_GETPASS_FOR_GETPASS_GNU. * modules/getpass-gnu (configure.ac): Test REPLACE_GETPASS_FOR_GETPASS_GNU instead of REPLACE_GETPASS. Set a module indicator. * lib/unistd.in.h (getpass): Test REPLACE_GETPASS, REPLACE_GETPASS_FOR_GETPASS_GNU, and the respective module indicators instead of just REPLACE_GETPASS.
* maint: avoid empty lines in recipesPaul Eggert2021-12-241-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AIX 7.2 ‘make’ complains about recipe lines that are empty after macro expansion, and I suppose there’s a good chance some non-POSIX ‘make’ would prohibit them. Rework macros so that we can avoid them. * gnulib-tool (func_emit_lib_Makefile_am) (func_emit_lib_Makefile_am): Support @!NMD@ too. * modules/gen-header (@gl_V_at): New macro. * modules/alloca-opt, modules/argz, modules/assert-h: * modules/byteswap, modules/configmake, modules/ctype: * modules/dirent, modules/errno, modules/execinfo, modules/fcntl-h: * modules/float, modules/fnmatch-h, modules/getopt-posix: * modules/glob-h, modules/iconv-h, modules/ieee754-h: * modules/inttypes-incomplete, modules/langinfo: * modules/libtextstyle-optional, modules/limits-h, modules/locale: * modules/malloc-h, modules/math, modules/monetary, modules/netdb: * modules/openmp-init, modules/poll-h, modules/posix-shell: * modules/pthread-h, modules/pty, modules/sched, modules/search: * modules/signal-h, modules/sigsegv, modules/snippet/link-warning: * modules/spawn, modules/stdalign, modules/stdarg, modules/stdbool: * modules/stddef, modules/stdint, modules/stdio, modules/stdlib: * modules/stdnoreturn, modules/string, modules/strings: * modules/sysexits, modules/termios, modules/threads-h: * modules/time, modules/uchar, modules/unicase/base: * modules/uniconv/base, modules/unictype/base, modules/unigbrk/base: * modules/unilbrk/base, modules/uniname/base, modules/uninorm/base: * modules/unistd, modules/unistdio/base, modules/unistr/base: * modules/unitypes, modules/uniwbrk/base, modules/uniwidth/base: * modules/utime-h, modules/wchar, modules/wctype-h: Use it.
* gen-header: new modulePaul Eggert2021-12-241-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify header generation by using Makefile variables defined by a new gen-header module. * modules/gen-header: New module. * modules/alloca-opt, modules/argz, modules/arpa_inet: * modules/assert-h, modules/byteswap: * modules/ctype, modules/dirent, modules/dynarray, modules/errno: * modules/execinfo, modules/fcntl-h, modules/float: * modules/fnmatch-h, modules/getopt-posix, modules/glob-h: * modules/iconv-h, modules/ieee754-h, modules/inttypes-incomplete: * modules/langinfo, modules/libtextstyle-optional, modules/limits-h: * modules/locale, modules/malloc-h, modules/math, modules/monetary: * modules/net_if, modules/netdb, modules/netinet_in: * modules/openmp-init, modules/poll-h: * modules/pthread-h, modules/pty, modules/sched: * modules/scratch_buffer, modules/search, modules/selinux-h: * modules/signal-h, modules/sigsegv: * modules/spawn, modules/stdalign, modules/stdarg, modules/stdbool: * modules/stddef, modules/stdint, modules/stdio, modules/stdlib: * modules/stdnoreturn, modules/string, modules/strings: * modules/sys_file, modules/sys_ioctl, modules/sys_random: * modules/sys_resource, modules/sys_select, modules/sys_socket: * modules/sys_stat, modules/sys_time, modules/sys_times: * modules/sys_types, modules/sys_uio, modules/sys_utsname: * modules/sys_wait, modules/sysexits, modules/termios: * modules/threads-h, modules/time, modules/uchar: * modules/unicase/base, modules/unicase/special-casing: * modules/uniconv/base, modules/unictype/base, modules/unigbrk/base: * modules/unilbrk/base, modules/uniname/base, modules/uninorm/base: * modules/unistd, modules/unistdio/base, modules/unistr/base: * modules/unitypes, modules/uniwbrk/base, modules/uniwidth/base: * modules/utime-h, modules/wchar, modules/wctype-h: Depend on gen-header, and use its macros to simplify header generation.
* maint: omit unnecessary ‘rm -f $@-t $@’Paul Eggert2021-12-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/alloca-opt, modules/argz, modules/arpa_inet: * modules/assert-h, modules/byteswap, modules/configmake: * modules/ctype, modules/dirent, modules/dynarray, modules/errno: * modules/execinfo, modules/fcntl-h, modules/float: * modules/fnmatch-h, modules/getopt-posix, modules/glob-h: * modules/iconv-h, modules/ieee754-h, modules/inttypes-incomplete: * modules/langinfo, modules/libtextstyle-optional: * modules/limits-h, modules/langinfo, modules/libgmp, modules/limits-h: * modules/locale, modules/malloc-h, modules/math, modules/monetary: * modules/net_if, modules/netdb, modules/netinet_in: * modules/openmp-init, modules/poll-h, modules/posix-shell: * modules/posix_spawnp-tests, modules/pthread-h, modules/pty: * modules/sched, modules/scratch_buffer, modules/search: * modules/selinux-h, modules/signal-h, modules/sigsegv: * modules/snippet/link-warning, modules/spawn, modules/stdalign: * modules/stdarg, modules/stdbool, modules/stddef, modules/stdint: * modules/stdio, modules/stdlib, modules/stdnoreturn: * modules/string, modules/strings, modules/sys_file: * modules/sys_ioctl, modules/sys_random, modules/sys_resource: * modules/sys_select, modules/sys_socket, modules/sys_stat: * modules/sys_time, modules/sys_times, modules/sys_types: * modules/sys_uio, modules/sys_utsname, modules/sys_wait: * modules/sysexits, modules/termios, modules/threads-h: * modules/time, modules/uchar, modules/unicase/base: * modules/unicase/special-casing, modules/uniconv/base: * modules/unictype/base, modules/unigbrk/base, modules/unilbrk/base: * modules/uniname/base, modules/uninorm/base, modules/unistd: * modules/unistdio/base, modules/unistr/base, modules/unitypes: * modules/uniwbrk/base, modules/uniwidth/base, modules/utime-h: * modules/wchar, modules/wctype-h: Don’t bother to do a ‘rm -f $@-t $@’ at the start of recipes that create .h and similar files. This is a revenant of a style in which the files were created read-only. Also, consistently use use plain ‘mv $@-t $@’ afterwards, instead of usually using ‘mv -f’ but sometimes plain ‘mv’.
* Optimize redundant 'mkdir -p .' invocations.Bruno Haible2021-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Paul Eggert. * gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am): Eliminate @NMD@ tokens. * modules/alloca-opt (Makefile.am): Prefix the "$(MKDIR_P) '%reldir%'" line with @NMD@. * modules/argz (Makefile.am): Likewise. * modules/assert-h (Makefile.am): Likewise. * modules/byteswap (Makefile.am): Likewise. * modules/configmake (Makefile.am): Likewise. * modules/ctype (Makefile.am): Likewise. * modules/dirent (Makefile.am): Likewise. * modules/errno (Makefile.am): Likewise. * modules/execinfo (Makefile.am): Likewise. * modules/fcntl-h (Makefile.am): Likewise. * modules/float (Makefile.am): Likewise. * modules/fnmatch-h (Makefile.am): Likewise. * modules/getopt-posix (Makefile.am): Likewise. * modules/glob-h (Makefile.am): Likewise. * modules/iconv-h (Makefile.am): Likewise. * modules/ieee754-h (Makefile.am): Likewise. * modules/inttypes-incomplete (Makefile.am): Likewise. * modules/langinfo (Makefile.am): Likewise. * modules/libtextstyle-optional (Makefile.am): Likewise. * modules/limits-h (Makefile.am): Likewise. * modules/locale (Makefile.am): Likewise. * modules/malloc-h (Makefile.am): Likewise. * modules/math (Makefile.am): Likewise. * modules/monetary (Makefile.am): Likewise. * modules/netdb (Makefile.am): Likewise. * modules/openmp-init (Makefile.am): Likewise. * modules/poll-h (Makefile.am): Likewise. * modules/posix-shell (Makefile.am): Likewise. * modules/pthread-h (Makefile.am): Likewise. * modules/pty (Makefile.am): Likewise. * modules/sched (Makefile.am): Likewise. * modules/search (Makefile.am): Likewise. * modules/signal-h (Makefile.am): Likewise. * modules/sigsegv (Makefile.am): Likewise. * modules/snippet/link-warning (Makefile.am): Likewise. * modules/spawn (Makefile.am): Likewise. * modules/stdalign (Makefile.am): Likewise. * modules/stdarg (Makefile.am): Likewise. * modules/stdbool (Makefile.am): Likewise. * modules/stddef (Makefile.am): Likewise. * modules/stdint (Makefile.am): Likewise. * modules/stdio (Makefile.am): Likewise. * modules/stdlib (Makefile.am): Likewise. * modules/stdnoreturn (Makefile.am): Likewise. * modules/string (Makefile.am): Likewise. * modules/strings (Makefile.am): Likewise. * modules/sysexits (Makefile.am): Likewise. * modules/termios (Makefile.am): Likewise. * modules/threads-h (Makefile.am): Likewise. * modules/time (Makefile.am): Likewise. * modules/uchar (Makefile.am): Likewise. * modules/unicase/base (Makefile.am): Likewise. * modules/uniconv/base (Makefile.am): Likewise. * modules/unictype/base (Makefile.am): Likewise. * modules/unigbrk/base (Makefile.am): Likewise. * modules/unilbrk/base (Makefile.am): Likewise. * modules/uniname/base (Makefile.am): Likewise. * modules/uninorm/base (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * modules/unistdio/base (Makefile.am): Likewise. * modules/unistr/base (Makefile.am): Likewise. * modules/unitypes (Makefile.am): Likewise. * modules/uniwbrk/base (Makefile.am): Likewise. * modules/uniwidth/base (Makefile.am): Likewise. * modules/utime-h (Makefile.am): Likewise. * modules/wchar (Makefile.am): Likewise. * modules/wctype-h (Makefile.am): Likewise.
* Fix creation of build directories with non-recursive-gnulib-prefix-hack.Bruno Haible2021-12-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary for executing "make" in a VPATH build of a package that uses prefix-gnulib-mk and a module such as alloca-opt. * modules/alloca-opt (Makefile.am): Before generating the .h-t file, ensure that the directory in which we want to create it exists. (configure.ac): Invoke AC_PROG_MKDIR_P. * modules/argz: Likewise. * modules/arpa_inet: Likewise. * modules/assert-h: Likewise. * modules/byteswap: Likewise. * modules/configmake: Likewise. * modules/ctype: Likewise. * modules/dirent: Likewise. * modules/dynarray: Likewise. * modules/errno: Likewise. * modules/execinfo: Likewise. * modules/fcntl-h: Likewise. * modules/float: Likewise. * modules/fnmatch-h: Likewise. * modules/getopt-posix: Likewise. * modules/glob-h: Likewise. * modules/iconv-h: Likewise. * modules/ieee754-h: Likewise. * modules/inttypes-incomplete: Likewise. * modules/langinfo: Likewise. * modules/libgmp: Likewise. * modules/libtextstyle-optional: Likewise. * modules/limits-h: Likewise. * modules/locale: Likewise. * modules/malloc-h: Likewise. * modules/math: Likewise. * modules/monetary: Likewise. * modules/net_if: Likewise. * modules/netdb: Likewise. * modules/netinet_in: Likewise. * modules/openmp-init: Likewise. * modules/poll-h: Likewise. * modules/posix-shell: Likewise. * modules/pthread-h: Likewise. * modules/pty: Likewise. * modules/sched: Likewise. * modules/scratch_buffer: Likewise. * modules/search: Likewise. * modules/selinux-h: Likewise. * modules/signal-h: Likewise. * modules/sigsegv: Likewise. * modules/snippet/link-warning: Likewise. * modules/spawn: Likewise. * modules/stdalign: Likewise. * modules/stdarg: Likewise. * modules/stdbool: Likewise. * modules/stddef: Likewise. * modules/stdint: Likewise. * modules/stdio: Likewise. * modules/stdlib: Likewise. * modules/stdnoreturn: Likewise. * modules/string: Likewise. * modules/strings: Likewise. * modules/sys_file: Likewise. * modules/sys_ioctl: Likewise. * modules/sys_random: Likewise. * modules/sys_resource: Likewise. * modules/sys_select: Likewise. * modules/sys_socket: Likewise. * modules/sys_stat: Likewise. * modules/sys_time: Likewise. * modules/sys_times: Likewise. * modules/sys_types: Likewise. * modules/sys_uio: Likewise. * modules/sys_utsname: Likewise. * modules/sys_wait: Likewise. * modules/sysexits: Likewise. * modules/termios: Likewise. * modules/threads-h: Likewise. * modules/time: Likewise. * modules/uchar: Likewise. * modules/unicase/base: Likewise. * modules/unicase/special-casing: Likewise. * modules/uniconv/base: Likewise. * modules/unictype/base: Likewise. * modules/unigbrk/base: Likewise. * modules/unilbrk/base: Likewise. * modules/uniname/base: Likewise. * modules/uninorm/base: Likewise. * modules/unistd: Likewise. * modules/unistdio/base: Likewise. * modules/unistr/base: Likewise. * modules/unitypes: Likewise. * modules/uniwbrk/base: Likewise. * modules/uniwidth/base: Likewise. * modules/utime-h: Likewise. * modules/wchar: Likewise. * modules/wctype-h: Likewise. * gnulib-tool (func_emit_lib_Makefile_am): When producing output for GNU make, eliminate %reldir% tokens.
* Align 2011-11-26 patch to 2021-04-11 patch (regression from 2021-04-11).Bruno Haible2021-06-131-1/+1
| | | | | | | | | | | | | Reported by Paul Eggert. * m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Also initialize GNULIB_UNISTD_H_GETOPT variable. * modules/getopt-posix (configure.ac): Set GNULIB_UNISTD_H_GETOPT variable. * modules/unistd (Makefile.am): Rely on ${gl_include_guard_prefix} processing done by gnulib-tool since 2021-04-11. * gnulib-tool: Revert last change. * pygnulib/GLEmiter.py: Likewise.
* Support several gnulib-tool invocations under the same configure.ac.Bruno Haible2021-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00104.html>. This is done by defining the Gnulib module indicator variables per gnulib-tool invocation. So that a generated .h file is no longer influenced by the set of modules used in other gnulib-tool invocations. * gnulib-tool (func_compute_include_guard_prefix): Set module_indicator_prefix. (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am): Use it to modify $(GNULIB_*) variable references in the Automake snippets. (func_emit_initmacro_start): Push macro definitions for GL_MACRO_PREFIX and GL_MODULE_INDICATOR_PREFIX. (func_emit_initmacro_end): Pop these macro definitions. * pygnulib/GLConfig.py (GLConfig.getIncludeGuardPrefix): New method. * pygnulib/GLEmiter.py (GLEmiter.initmacro_start): Push macro definitions for GL_MACRO_PREFIX and GL_MODULE_INDICATOR_PREFIX. (GLEmiter.initmacro_end): Pop these macro definitions. (GLEmiter.lib_Makefile_am, GLEmiter.tests_Makefile_am): Use the module indicator prefix to modify $(GNULIB_*) variable references in the Automake snippets. * m4/gnulib-common.m4 (gl_MODULE_INDICATOR_INIT_VARIABLE, gl_MODULE_INDICATOR_SET_VARIABLE): Use the value of GL_MODULE_INDICATOR_PREFIX. * m4/arpa_inet_h.m4: Use new idiom for header files that contain references to Gnulib module indicator variables: - Define the main macro through AC_DEFUN_ONCE. - Define a macro gl_*_H_REQUIRE_DEFAULTS that initializes the Gnulib module indicator variables (each prefixed with GL_MODULE_INDICATOR_PREFIX). - Invoke this macro in the gl_*_MODULE_INDICATOR macro. * m4/ctype.m4: Likewise. * m4/dirent_h.m4: Likewise. * m4/fcntl_h.m4: Likewise. * m4/fnmatch_h.m4: Likewise. * m4/glob_h.m4: Likewise. * m4/iconv_h.m4: Likewise. * m4/inttypes.m4: Likewise. * m4/langinfo_h.m4: Likewise. * m4/locale_h.m4: Likewise. * m4/malloc_h.m4: Likewise. * m4/math_h.m4: Likewise. * m4/monetary_h.m4: Likewise. * m4/netdb_h.m4: Likewise. * m4/poll_h.m4: Likewise. * m4/pthread_h.m4: Likewise. * m4/pty_h.m4: Likewise. * m4/sched_h.m4: Likewise. * m4/search_h.m4: Likewise. * m4/signal_h.m4: Likewise. * m4/spawn_h.m4: Likewise. * m4/stddef_h.m4: Likewise. * m4/stdio_h.m4: Likewise. * m4/stdlib_h.m4: Likewise. * m4/string_h.m4: Likewise. * m4/strings_h.m4: Likewise. * m4/sys_file_h.m4: Likewise. * m4/sys_ioctl_h.m4: Likewise. * m4/sys_random_h.m4: Likewise. * m4/sys_resource_h.m4: Likewise. * m4/sys_select_h.m4: Likewise. * m4/sys_socket_h.m4: Likewise. * m4/sys_stat_h.m4: Likewise. * m4/sys_time_h.m4: Likewise. * m4/sys_times_h.m4: Likewise. * m4/sys_types_h.m4: Likewise. * m4/sys_uio_h.m4: Likewise. * m4/sys_utsname_h.m4: Likewise. * m4/sys_wait_h.m4: Likewise. * m4/termios_h.m4: Likewise. * m4/threads.m4: Likewise. * m4/time_h.m4: Likewise. * m4/uchar.m4: Likewise. * m4/unistd_h.m4: Likewise. * m4/utime_h.m4: Likewise. * m4/wchar_h.m4: Likewise. * m4/wctype_h.m4: Likewise. * modules/arpa_inet (configure.ac): Invoke the macro gl_*_H_REQUIRE_DEFAULTS explicitly. * modules/ctype (configure.ac): Likewise. * modules/dirent (configure.ac): Likewise. * modules/fcntl-h (configure.ac): Likewise. * modules/fnmatch-h (configure.ac): Likewise. * modules/glob-h (configure.ac): Likewise. * modules/iconv-h (configure.ac): Likewise. * modules/inttypes-incomplete (configure.ac): Likewise. * modules/langinfo (configure.ac): Likewise. * modules/locale (configure.ac): Likewise. * modules/malloc-h (configure.ac): Likewise. * modules/math (configure.ac): Likewise. * modules/monetary (configure.ac): Likewise. * modules/netdb (configure.ac): Likewise. * modules/poll-h (configure.ac): Likewise. * modules/pthread-h (configure.ac): Likewise. * modules/pty (configure.ac): Likewise. * modules/sched (configure.ac): Likewise. * modules/search (configure.ac): Likewise. * modules/signal-h (configure.ac): Likewise. * modules/spawn (configure.ac): Likewise. * modules/stddef (configure.ac): Likewise. * modules/stdio (configure.ac): Likewise. * modules/stdlib (configure.ac): Likewise. * modules/string (configure.ac): Likewise. * modules/strings (configure.ac): Likewise. * modules/sys_file (configure.ac): Likewise. * modules/sys_ioctl (configure.ac): Likewise. * modules/sys_random (configure.ac): Likewise. * modules/sys_resource (configure.ac): Likewise. * modules/sys_select (configure.ac): Likewise. * modules/sys_socket (configure.ac): Likewise. * modules/sys_stat (configure.ac): Likewise. * modules/sys_time (configure.ac): Likewise. * modules/sys_times (configure.ac): Likewise. * modules/sys_types (configure.ac): Likewise. * modules/sys_uio (configure.ac): Likewise. * modules/sys_utsname (configure.ac): Likewise. * modules/sys_wait (configure.ac): Likewise. * modules/termios (configure.ac): Likewise. * modules/threads-h (configure.ac): Likewise. * modules/time (configure.ac): Likewise. * modules/uchar (configure.ac): Likewise. * modules/unistd (configure.ac): Likewise. * modules/utime-h (configure.ac): Likewise. * modules/wchar (configure.ac): Likewise. * modules/wctype-h (configure.ac): Likewise. * m4/af_alg.m4: Update after a macro name changed. * m4/ctime.m4: Likewise. * m4/explicit_bzero.m4: Likewise. * m4/ffs.m4: Likewise. * m4/ffsl.m4: Likewise. * m4/ffsll.m4: Likewise. * m4/flock.m4: Likewise. * m4/fstat.m4: Likewise. * m4/getaddrinfo.m4: Likewise. * m4/getdomainname.m4: Likewise. * m4/gettimeofday.m4: Likewise. * m4/hostent.m4: Likewise. * m4/ioctl.m4: Likewise. * m4/localtime.m4: Likewise. * m4/mbslen.m4: Likewise. * m4/memchr.m4: Likewise. * m4/memmem.m4: Likewise. * m4/mempcpy.m4: Likewise. * m4/memrchr.m4: Likewise. * m4/mktime.m4: Likewise. * m4/nanosleep.m4: Likewise. * m4/passfd.m4: Likewise. * m4/pselect.m4: Likewise. * m4/rawmemchr.m4: Likewise. * m4/select.m4: Likewise. * m4/servent.m4: Likewise. * m4/sigabbrev_np.m4: Likewise. * m4/sigdescr_np.m4: Likewise. * m4/sockpfaf.m4: Likewise. * m4/stat.m4: Likewise. * m4/stpcpy.m4: Likewise. * m4/stpncpy.m4: Likewise. * m4/strcase.m4: Likewise. * m4/strcasestr.m4: Likewise. * m4/strchrnul.m4: Likewise. * m4/strdup.m4: Likewise. * m4/strerror.m4: Likewise. * m4/strerror_r.m4: Likewise. * m4/strerrorname_np.m4: Likewise. * m4/strftime-fixes.m4: Likewise. * m4/strncat.m4: Likewise. * m4/strndup.m4: Likewise. * m4/strnlen.m4: Likewise. * m4/strpbrk.m4: Likewise. * m4/strptime.m4: Likewise. * m4/strsep.m4: Likewise. * m4/strsignal.m4: Likewise. * m4/strstr.m4: Likewise. * m4/strtok_r.m4: Likewise. * m4/strverscmp.m4: Likewise. * m4/time_r.m4: Likewise. * m4/time_rz.m4: Likewise. * m4/timegm.m4: Likewise. * m4/timespec_get.m4: Likewise. * m4/tzset.m4: Likewise. * modules/accept (configure.ac): Likewise. * modules/bind (configure.ac): Likewise. * modules/connect (configure.ac): Likewise. * modules/flock (configure.ac): Likewise. * modules/getpeername (configure.ac): Likewise. * modules/getsockname (configure.ac): Likewise. * modules/getsockopt (configure.ac): Likewise. * modules/listen (configure.ac): Likewise. * modules/recv (configure.ac): Likewise. * modules/recvfrom (configure.ac): Likewise. * modules/send (configure.ac): Likewise. * modules/sendto (configure.ac): Likewise. * modules/setsockopt (configure.ac): Likewise. * modules/shutdown (configure.ac): Likewise. * modules/socket (configure.ac): Likewise. Use the gl_*_H_REQUIRE_DEFAULTS macros. * modules/nonblocking (configure.ac): Use the gl_*_H_REQUIRE_DEFAULTS and gl_MODULE_INDICATOR_INIT_VARIABLE macros. * modules/sigpipe (configure.ac): Likewise. * modules/windows-stat-override (configure.ac): Likewise. * m4/nonblocking.m4: Update a comment. * m4/sigpipe.m4: Likewise.
* execve, execvpe, execvp, execv, execl, execle, execlp: Prepare modules.Bruno Haible2020-12-261-0/+15
| | | | | | | | | | | | | * lib/unistd.in.h (execl, execle, execlp, execv, execve, execvp, execvpe): Add declarations for the new modules. * m4/unistd_h.m4 (gl_UNISTD_H): Test whether execl, execle, execlp, execv, execve, execvp, execvpe are declared. (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_EXEC*, HAVE_EXECVPE, REPLACE_EXEC*. * modules/unistd (Makefile.am): Substitute GNULIB_EXEC*, HAVE_EXECVPE, REPLACE_EXEC*. * tests/test-unistd-c++.cc: Check the signature of execl, execle, execlp, execv, execve, execvp, execvpe.
* Make it possible to turn off each of the Windows oldnames workarounds.Bruno Haible2020-12-251-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/fcntl.in.h (creat, open): Conditionalize each of the Windows oldnames workarounds through a GNULIB_MDA_<func> symbol. * lib/math.in.h (j0, j1, jn, y0, y1, yn): Likewise. * lib/search.in.h (lfind, lsearch): Likewise. * lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam): Likewise. * lib/stdlib.in.h (ecvt, fcvt, gcvt, mktemp, putenv): Likewise. * lib/string.in.h (memccpy, strdup): Likewise. * lib/sys_stat.in.h (chmod, umask): Likewise. * lib/time.in.h (tzset): Likewise. * lib/unistd.in.h (access, chdir, close, dup, dup2, execl, execle, execlp, execv, execve, execvp, execvpe, getcwd, getpid, isatty, lseek, read, rmdir, swab, unlink, write): Likewise. * lib/utime.in.h (utime): Likewise. * lib/wchar.in.h (wcsdup): Likewise. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize these GNULIB_MDA_<func> symbols. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Likewise. * m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Likewise. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/utime_h.m4 (gl_UTIME_H_DEFAULTS): Likewise. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Likewise. * modules/fcntl-h (Makefile.am): Substitute these GNULIB_MDA_<func> symbols. * modules/math (Makefile.am): Likewise. * modules/search (Makefile.am): Likewise. * modules/stdio (Makefile.am): Likewise. * modules/stdlib (Makefile.am): Likewise. * modules/string (Makefile.am): Likewise. * modules/sys_stat (Makefile.am): Likewise. * modules/time (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * modules/utime-h (Makefile.am): Likewise. * modules/wchar (Makefile.am): Likewise.
* Do the Windows oldnames workaround through the C++ GNULIB_NAMESPACE.Bruno Haible2020-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Daniel R. Hurtmans <Daniel.Hurtmans@ulb.ac.be> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00029.html>. * lib/c++defs.h (_GL_CXXALIAS_MDA_CAST): New macro. * lib/fcntl.in.h (creat, open): In C++ mode, when GNULIB_NAMESPACE is defined: 1. Define a symbol in this namespace. 2. Don't redirect using a preprocessor #define. * lib/math.in.h (j0, j1, jn, y0, y1, yn): Likewise. * lib/search.in.h (lfind, lsearch): Likewise. * lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam): Likewise. * lib/stdlib.in.h (ecvt, fcvt, gcvt, mktemp, putenv): Likewise. * lib/string.in.h (memccpy, strdup): Likewise. * lib/sys_stat.in.h (chmod, umask): Likewise. * lib/time.in.h (tzset): Likewise. * lib/unistd.in.h (access, chdir, close, dup, dup2, execl, execle, execlp, execv, execve, execvp, execvpe, getcwd, getpid, isatty, lseek, read, rmdir, swab, unlink, write): Likewise. * lib/utime.in.h (utime): Likewise. * lib/wchar.in.h (wcsdup): Likewise. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize HAVE_DECL_FCLOSEALL. (gl_STDIO_H): Set HAVE_DECL_FCLOSEALL. * modules/stdio (Makefile.am): Substitute HAVE_DECL_FCLOSEALL. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize HAVE_DECL_ECVT, HAVE_DECL_FCVT, HAVE_DECL_GCVT. (gl_STDLIB_H): Set HAVE_DECL_ECVT, HAVE_DECL_FCVT, HAVE_DECL_GCVT. * modules/stdlib (Makefile.am): Substitute HAVE_DECL_ECVT, HAVE_DECL_FCVT, HAVE_DECL_GCVT. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_EXECVPE. (gl_UNISTD_H): Set HAVE_DECL_EXECVPE. * modules/unistd (Makefile.am): Substitute HAVE_DECL_EXECVPE. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize HAVE_DECL_WCSDUP. (gl_WCHAR_H): Set HAVE_DECL_WCSDUP. * modules/wchar (Makefile.am): Substitute HAVE_DECL_WCSDUP.
* sys_types: Fix definition of pid_t on 64-bit MSVC.Bruno Haible2020-08-241-0/+1
| | | | | | | | | | | | | | * m4/pid_t.m4: New file. * modules/sys_types (Files): Add it. * modules/dirent (Files): Likewise. * modules/fcntl-h (Files): Likewise. * modules/sched (Files): Likewise. * modules/signal-h (Files): Likewise. * modules/spawn (Files): Likewise. * modules/sys_stat (Files): Likewise. * modules/sys_wait (Files): Likewise. * modules/termios (Files): Likewise. * modules/unistd (Files): Likewise.
* dup2: Remove support for some very old platforms.Bruno Haible2020-07-081-1/+0
| | | | | | | | | | | | | | * m4/dup2-obsolete.m4: Remove file. * modules/dup2-obsolete: Remove file. * m4/dup2.m4 (gl_FUNC_DUP2): Assume module 'dup2-obsolete' is absent. Don't define HAVE_DUP2. * lib/unistd.in.h (dup2): Assume HAVE_DUP2 is 1. * lib/dup2.c: Likewise. * modules/dup2 (Depends-on, configure.ac): Likewise. (Depends-on): Remove dup2-obsolete. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Don't initialize HAVE_DUP2. * modules/unistd (Makefile.am): Don't substitute HAVE_DUP2. * doc/posix-functions/dup2.texi: Don't mention module 'dup2-obsolete'.
* getentropy: Work around a macOS and Solaris problem.Bruno Haible2020-05-311-0/+1
| | | | | | | | | | | | * lib/unistd.in.h: Include <sys/random.h>, when needed for the 'getentropy' module. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize UNISTD_H_HAVE_SYS_RANDOM_H. * m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Set UNISTD_H_HAVE_SYS_RANDOM_H. * modules/unistd (Makefile.am): Substitute UNISTD_H_HAVE_SYS_RANDOM_H. * doc/glibc-functions/getentropy.texi: Document the macOS and Solaris problem. List more platforms.
* unistd: Remove conflicting declaration of getrandom().Bruno Haible2020-05-301-2/+0
| | | | | | | | | | * lib/unistd.in.h (getrandom): Remove declaration. * m4/unistd_h.m4 (gl_UNISTD_H): Don't test whether getrandom is declared. (gl_UNISTD_H_DEFAULTS): Don't initialize GNULIB_GETRANDOM, HAVE_GETRANDOM. * modules/unistd (Makefile.am): Don't substitute GNULIB_GETRANDOM, HAVE_GETRANDOM.
* getentropy, getrandom: new modulesPaul Eggert2020-05-251-0/+4
| | | | | | | | | | | | | | | | | * MODULES.html.sh (func_all_modules): * lib/unistd.in.h (getentropy, getrandom): * m4/unistd_h.m4 (gl_UNISTD_H, gl_UNISTD_H_DEFAULTS): * modules/unistd (unistd.h): Add support for getentropy, getrandom. * doc/glibc-functions/getentropy.texi (getentropy): * doc/glibc-functions/getrandom.texi (getrandom): These are now fixed on some platforms. * lib/getentropy.c, lib/getrandom.c, lib/sys_random.in.h: * m4/getentropy.m4, m4/getrandom.m4: * modules/getentropy, modules/getentropy-tests: * modules/getrandom, modules/getrandom-tests: * tests/test-getentropy.c, tests/test-getrandom.c: New files.
* getopt-posix: Fix compilation failure in testdirs.Bruno Haible2020-01-031-0/+1
| | | | | | | | | * lib/unistd.in.h: Include <getopt-cdefs.h> and <getopt-pfx-core.h> only when the gnulib module 'getopt-posix' is enabled. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETOPT_POSIX. * modules/getopt-posix (configure.ac): Set GNULIB_GETOPT_POSIX as a module indicator. * modules/unistd (Makefile.am): Substitute GNULIB_GETOPT_POSIX.
* access: New module.Bruno Haible2019-09-151-1/+3
| | | | | | | | | | | | | * lib/unistd.in.h (access): New declaration. * lib/access.c: New file. * m4/access.m4: New file. * m4/unistd_h.m4 (gl_UNISTD_H): Test whether access is declared. (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_ACCESS, REPLACE_ACCESS. * modules/unistd (Makefile.am): Substitute GNULIB_ACCESS, REPLACE_ACCESS. * modules/access: New file. * tests/test-unistd-c++.cc (access): Check signature. * doc/posix-functions/access.texi: Mention the new module.
* copy-file-range: new modulePaul Eggert2019-06-041-0/+2
| | | | | | | | | | * MODULES.html.sh: Add copy-file-range. * lib/copy-file-range.c, m4/copy-file-range.m4: * modules/copy-file-range: New files. * lib/unistd.in.h (copy_file_range): Declare. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set up GNULIB_COPY_FILE_RANGE and HAVE_COPY_FILE_RANGE. * modules/unistd (unistd.h): Substitute them.
* getpass: Move declaration to <unistd.h>.Bruno Haible2018-08-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | * lib/unistd.in.h (getpass): New declaration. * lib/getpass.h: Replace with a stub that just includes <unistd.h>. * m4/getpass.m4 (gl_FUNC_GETPASS): Declare through AC_DEFUN_ONCE. Require gl_UNISTD_H_DEFAULTS. Don't test whether getpass is declared. (gl_FUNC_GETPASS_GNU): Require gl_UNISTD_H_DEFAULTS and gl_FUNC_GETPASS. On glibc systems, don't set REPLACE_GETPASS to 1. * modules/getpass (Depends-on): Add 'unistd'. (configure.ac): Test also REPLACE_GETPASS. Define a module indicator. (Include): Specify <unistd.h> instead of "getpass.h". * modules/getpass-gnu (Depends-on): Merely depend on 'getpass'. (configure.ac): Sync with the configure.ac section of modules/getpass. (Include): Specify <unistd.h> instead of "getpass.h". * m4/unistd_h.m4 (gl_UNISTD_H): Test whether getpass is declared. (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETPASS, HAVE_GETPASS, REPLACE_GETPASS. * modules/unistd (Makefile.am): Substitute GNULIB_GETPASS, HAVE_GETPASS, REPLACE_GETPASS. * tests/test-unistd-c++.cc: Test also the declaration of 'getpass'. * doc/glibc-functions/getpass.texi: A length limit exists also on uClibc and musl. * NEWS: Mention the change.
* truncate: Fix compilation error on Android.Bruno Haible2018-05-141-1/+1
| | | | | | | | | | | | | * 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.
* faccessat: port to macOS (Bug#29231)Paul Eggert2017-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* truncate: New module.Bruno Haible2017-05-131-0/+3
| | | | | | | | | | | | | | * 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.
* getlogin: Port to newer mingw.Bruno Haible2016-12-171-1/+1
| | | | | | | | | | | * 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.
* symlinkat: port to AIX 7.1Paul Eggert2014-10-181-0/+1
| | | | | | | | | | | | | * 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.
* readlinkat: port to AIX 7.1Paul Eggert2014-10-181-0/+1
| | | | | | | | | | | | | | * 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.
* getdtablesize: work around cygwin issueEric Blake2013-09-261-0/+1
| | | | | | | | | | | | | | | | | | | | | 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: Eric Blake <eblake@redhat.com>
* unistd: better 'inline'Paul Eggert2012-11-291-0/+3
| | | | | | | | | | * 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.
* unistd_h: make it easier to avoid sys_types_hPaul Eggert2012-05-041-0/+1
| | | | | | | | | | | | | 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.
* Large File Support for native Windows platforms.Bruno Haible2012-04-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>.
* New module 'isatty'.Bruno Haible2012-01-031-0/+2
| | | | | | | | | | | | | | * 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.
* Tweak last commit.Bruno Haible2011-12-031-1/+1
| | | | | | | * 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.
* Integrate the sethostname module into unistdBen Walton2011-12-031-0/+3
| | | | | | | | | | | | | 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: Ben Walton <bwalton@artsci.utoronto.ca>
* Fix conflict between two instantiations of module 'unistd'.Bruno Haible2011-11-261-1/+1
| | | | | | | | | | | | | | * 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.
* New module 'dup'.Bruno Haible2011-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* New module 'chdir'.Bruno Haible2011-09-231-0/+1
| | | | | | | | | | | | | | | * 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.
* fdatasync: port to MacOS X 10.7Eric Blake2011-09-161-0/+1
| | | | | | | | | | | | | | | 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: Eric Blake <eblake@redhat.com>
* fdatasync: new moduleEric Blake2011-09-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Eric Blake <eblake@redhat.com>
* Support for MSVC compiler: Ensure ssize_t gets defined.Bruno Haible2011-09-151-0/+1
| | | | | | | | | | | | * doc/posix-headers/sys_types.texi: Mention the missing ssize_t problem. * doc/posix-headers/stdio.texi: Likewise. * modules/stdio (Depends-on): Add ssize_t. * modules/sys_socket (Depends-on): Likewise. * modules/sys_types (Depends-on): Likewise. * modules/sys_uio (Depends-on): Likewise. * modules/unistd (Depends-on): Likewise. * tests/test-sys_socket.c: Check that size_t and ssize_t are defined. * tests/test-sys_types.c: Check that ssize_t is defined.
* Rename module 'warn-on-use' to 'snippet/warn-on-use'.Bruno Haible2011-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/snippet/warn-on-use: Renamed from modules/warn-on-use. (Files, Makefile.am): Update. * build-aux/snippet/warn-on-use.h: Renamed from build-aux/warn-on-use.h. * modules/arpa_inet (Depends-on): Update. * modules/ctype (Depends-on): Update. * modules/dirent (Depends-on): Update. * modules/fcntl-h (Depends-on): Update. * modules/glob (Depends-on): Update. * modules/iconv-h (Depends-on): Update. * modules/inttypes-incomplete (Depends-on): Update. * modules/langinfo (Depends-on): Update. * modules/locale (Depends-on): Update. * modules/math (Depends-on): Update. * modules/netdb (Depends-on): Update. * modules/poll-h (Depends-on): Update. * modules/pty (Depends-on): Update. * modules/search (Depends-on): Update. * modules/signal (Depends-on): Update. * modules/spawn (Depends-on): Update. * modules/stdio (Depends-on): Update. * modules/stdlib (Depends-on): Update. * modules/string (Depends-on): Update. * modules/strings (Depends-on): Update. * modules/sys_file (Depends-on): Update. * modules/sys_ioctl (Depends-on): Update. * modules/sys_select (Depends-on): Update. * modules/sys_socket (Depends-on): Update. * modules/sys_stat (Depends-on): Update. * modules/sys_time (Depends-on): Update. * modules/sys_times (Depends-on): Update. * modules/sys_utsname (Depends-on): Update. * modules/sys_wait (Depends-on): Update. * modules/termios (Depends-on): Update. * modules/time (Depends-on): Update. * modules/unistd (Depends-on): Update. * modules/wchar (Depends-on): Update. * modules/wctype-h (Depends-on): Update. * MODULES.html.sh (Support for building libraries and executables): Update.
* Rename module 'c++defs' to 'snippet/c++defs'.Bruno Haible2011-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/snippet/c++defs: Renamed from modules/c++defs. (Files, Makefile.am): Update. * build-aux/snippet/c++defs.h: Renamed from build-aux/c++defs.h. * modules/arpa_inet (Depends-on): Update. * modules/ctype (Depends-on): Update. * modules/dirent (Depends-on): Update. * modules/fcntl-h (Depends-on): Update. * modules/glob (Depends-on): Update. * modules/iconv-h (Depends-on): Update. * modules/langinfo (Depends-on): Update. * modules/locale (Depends-on): Update. * modules/math (Depends-on): Update. * modules/netdb (Depends-on): Update. * modules/poll-h (Depends-on): Update. * modules/pty (Depends-on): Update. * modules/search (Depends-on): Update. * modules/signal (Depends-on): Update. * modules/spawn (Depends-on): Update. * modules/stdio (Depends-on): Update. * modules/stdlib (Depends-on): Update. * modules/string (Depends-on): Update. * modules/strings (Depends-on): Update. * modules/sys_ioctl (Depends-on): Update. * modules/sys_select (Depends-on): Update. * modules/sys_socket (Depends-on): Update. * modules/sys_stat (Depends-on): Update. * modules/sys_time (Depends-on): Update. * modules/sys_wait (Depends-on): Update. * modules/termios (Depends-on): Update. * modules/time (Depends-on): Update. * modules/unistd (Depends-on): Update. * modules/wchar (Depends-on): Update. * modules/wctype-h (Depends-on): Update.
* Rename module 'arg-nonnull' to 'snippet/arg-nonnull'.Bruno Haible2011-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/snippet/arg-nonnull: Renamed from modules/arg-nonnull. (Files, Makefile.am): Update. * build-aux/snippet/arg-nonnull.h: Renamed from build-aux/arg-nonnull.h. * modules/argv-iter (Depends-on): Update. * modules/arpa_inet (Depends-on): Update. * modules/dirent (Depends-on): Update. * modules/fcntl-h (Depends-on): Update. * modules/fnmatch (Depends-on): Update. * modules/getopt-posix (Depends-on): Update. * modules/glob (Depends-on): Update. * modules/iconv-h (Depends-on): Update. * modules/inttypes-incomplete (Depends-on): Update. * modules/locale (Depends-on): Update. * modules/math (Depends-on): Update. * modules/netdb (Depends-on): Update. * modules/search (Depends-on): Update. * modules/signal (Depends-on): Update. * modules/spawn (Depends-on): Update. * modules/stdio (Depends-on): Update. * modules/stdlib (Depends-on): Update. * modules/string (Depends-on): Update. * modules/strings (Depends-on): Update. * modules/sys_socket (Depends-on): Update. * modules/sys_stat (Depends-on): Update. * modules/sys_time (Depends-on): Update. * modules/sys_times (Depends-on): Update. * modules/sys_utsname (Depends-on): Update. * modules/time (Depends-on): Update. * modules/unistd (Depends-on): Update. * modules/wchar (Depends-on): Update. * MODULES.html.sh (Support for building libraries and executables): Update.
* gnulib-tool: Better isolation between different gnulib-tool invocations.Bruno Haible2011-06-081-44/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnulib-tool: New option --witness-c-macro. (witness_c_macro): New variable. (func_emit_lib_Makefile_am): If --witness-c-macro was specified, let AM_CPPFLAGS define it as a C macro. (func_emit_tests_Makefile_am): Likewise. (func_import): Store witness_c_macro setting in gnulib-cache.m4 and read it from there. * m4/gnulib-common.m4 (gl_MODULE_INDICATOR_CONDITION): Define through m4_define, not AC_DEFUN. (gl_MODULE_INDICATOR_SET_VARIABLE_AUX, gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR): New macros. (gl_MODULE_INDICATOR_SET_VARIABLE): Use them. * modules/arpa_inet (Makefile.am): Use sed expression s/.../.../, not s|...|...|, to substitute the values of the GNULIB_* module indicator variables. * modules/dirent (Makefile.am): Likewise. * modules/fcntl-h (Makefile.am): Likewise. * modules/iconv-h (Makefile.am): Likewise. * modules/langinfo (Makefile.am): Likewise. * modules/locale (Makefile.am): Likewise. * modules/math (Makefile.am): Likewise. * modules/netdb (Makefile.am): Likewise. * modules/poll-h (Makefile.am): Likewise. * modules/pty (Makefile.am): Likewise. * modules/search (Makefile.am): Likewise. * modules/signal (Makefile.am): Likewise. * modules/spawn (Makefile.am): Likewise. * modules/stdio (Makefile.am): Likewise. * modules/stdlib (Makefile.am): Likewise. * modules/string (Makefile.am): Likewise. * modules/sys_ioctl (Makefile.am): Likewise. * modules/sys_select (Makefile.am): Likewise. * modules/sys_socket (Makefile.am): Likewise. * modules/sys_stat (Makefile.am): Likewise. * modules/sys_times (Makefile.am): Likewise. * modules/sys_utsname (Makefile.am): Likewise. * modules/sys_wait (Makefile.am): Likewise. * modules/termios (Makefile.am): Likewise. * modules/time (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * modules/wchar (Makefile.am): Likewise.
* Allow multiple gnulib generated include files to be combined.Bruno Haible2011-05-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnulib-tool (func_compute_include_guard_prefix): New function. (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am): Resolve also ${gl_include_guard_prefix} references. (func_import, func_create_testdir): Invoke func_compute_include_guard_prefix. * lib/arpa_inet.in.h: Use the @GUARD_PREFIX@ placeholder. * lib/ctype.in.h: Likewise. * lib/dirent.in.h: Likewise. * lib/errno.in.h: Likewise. * lib/fcntl.in.h: Likewise. * lib/float.in.h: Likewise. * lib/getopt.in.h: Likewise. * lib/iconv.in.h: Likewise. * lib/langinfo.in.h: Likewise. * lib/locale.in.h: Likewise. * lib/math.in.h: Likewise. * lib/netdb.in.h: Likewise. * lib/netinet_in.in.h: Likewise. * lib/poll.in.h: Likewise. * lib/pthread.in.h: Likewise. * lib/pty.in.h: Likewise. * lib/sched.in.h: Likewise. * lib/se-selinux.in.h: Likewise. * lib/search.in.h: Likewise. * lib/signal.in.h: Likewise. * lib/spawn.in.h: Likewise. * lib/stdarg.in.h: Likewise. * lib/stddef.in.h: Likewise. * lib/stdint.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_time.in.h: Likewise. * lib/sys_times.in.h: Likewise. * lib/sys_uio.in.h: Likewise. * lib/sys_utsname.in.h: Likewise. * lib/sys_wait.in.h: Likewise. * lib/sysexits.in.h: Likewise. * lib/termios.in.h: Likewise. * lib/time.in.h: Likewise. * lib/unistd.in.h: Likewise. * lib/wchar.in.h: Likewise. * lib/wctype.in.h: Likewise. * modules/arpa_inet (Makefile.am): Substitute @GUARD_PREFIX@. * modules/ctype (Makefile.am): Likewise. * modules/dirent (Makefile.am): Likewise. * modules/errno (Makefile.am): Likewise. * modules/fcntl-h (Makefile.am): Likewise. * modules/float (Makefile.am): Likewise. * modules/getopt-posix (Makefile.am): Likewise. * modules/iconv-h (Makefile.am): Likewise. * modules/langinfo (Makefile.am): Likewise. * modules/locale (Makefile.am): Likewise. * modules/math (Makefile.am): Likewise. * modules/netdb (Makefile.am): Likewise. * modules/netinet_in (Makefile.am): Likewise. * modules/poll-h (Makefile.am): Likewise. * modules/pthread (Makefile.am): Likewise. * modules/pty (Makefile.am): Likewise. * modules/sched (Makefile.am): Likewise. * modules/search (Makefile.am): Likewise. * modules/selinux-h (Makefile.am): Likewise. * modules/signal (Makefile.am): Likewise. * modules/spawn (Makefile.am): Likewise. * modules/stdarg (Makefile.am): Likewise. * modules/stddef (Makefile.am): Likewise. * modules/stdint (Makefile.am): Likewise. * modules/stdio (Makefile.am): Likewise. * modules/stdlib (Makefile.am): Likewise. * modules/string (Makefile.am): Likewise. * modules/strings (Makefile.am): Likewise. * modules/sys_file (Makefile.am): Likewise. * modules/sys_ioctl (Makefile.am): Likewise. * modules/sys_select (Makefile.am): Likewise. * modules/sys_socket (Makefile.am): Likewise. * modules/sys_stat (Makefile.am): Likewise. * modules/sys_time (Makefile.am): Likewise. * modules/sys_times (Makefile.am): Likewise. * modules/sys_uio (Makefile.am): Likewise. * modules/sys_utsname (Makefile.am): Likewise. * modules/sys_wait (Makefile.am): Likewise. * modules/sysexits (Makefile.am): Likewise. * modules/termios (Makefile.am): Likewise. * modules/time (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * modules/wchar (Makefile.am): Likewise. * modules/wctype-h (Makefile.am): Likewise. * modules/assert-h (Makefile.am): Replace _GL_VERIFY_H specially.
* group-member: Declare function in <unistd.h>.Bruno Haible2011-05-121-0/+2
| | | | | | | | | | | | | | | | | | | | * 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.
* Support non-blocking pipe I/O in read() on native Windows.Bruno Haible2011-04-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Support non-blocking pipe I/O in write() on native Windows.Bruno Haible2011-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Ensure to rebuild generated .h files when config.status has changed.Bruno Haible2011-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/arpa_inet (Makefile.am): Add dependency from .h file to config.status. * modules/ctype (Makefile.am): Likewise. * modules/dirent (Makefile.am): Likewise. * modules/errno (Makefile.am): Likewise. * modules/fcntl-h (Makefile.am): Likewise. * modules/float (Makefile.am): Likewise. * modules/getopt-posix (Makefile.am): Likewise. * modules/glob (Makefile.am): Likewise. * modules/iconv-h (Makefile.am): Likewise. * modules/inttypes (Makefile.am): Likewise. * modules/langinfo (Makefile.am): Likewise. * modules/locale (Makefile.am): Likewise. * modules/math (Makefile.am): Likewise. * modules/netdb (Makefile.am): Likewise. * modules/netinet_in (Makefile.am): Likewise. * modules/poll-h (Makefile.am): Likewise. * modules/pthread (Makefile.am): Likewise. * modules/pty (Makefile.am): Likewise. * modules/sched (Makefile.am): Likewise. * modules/search (Makefile.am): Likewise. * modules/selinux-h (Makefile.am): Likewise. * modules/signal (Makefile.am): Likewise. * modules/spawn (Makefile.am): Likewise. * modules/stdarg (Makefile.am): Likewise. * modules/stdbool (Makefile.am): Likewise. * modules/stddef (Makefile.am): Likewise. * modules/stdint (Makefile.am): Likewise. * modules/stdio (Makefile.am): Likewise. * modules/stdlib (Makefile.am): Likewise. * modules/string (Makefile.am): Likewise. * modules/strings (Makefile.am): Likewise. * modules/sys_file (Makefile.am): Likewise. * modules/sys_ioctl (Makefile.am): Likewise. * modules/sys_select (Makefile.am): Likewise. * modules/sys_socket (Makefile.am): Likewise. * modules/sys_stat (Makefile.am): Likewise. * modules/sys_time (Makefile.am): Likewise. * modules/sys_times (Makefile.am): Likewise. * modules/sys_utsname (Makefile.am): Likewise. * modules/sys_wait (Makefile.am): Likewise. * modules/sysexits (Makefile.am): Likewise. * modules/termios (Makefile.am): Likewise. * modules/time (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * modules/wchar (Makefile.am): Likewise. * modules/wctype-h (Makefile.am): Likewise. Reported by Karl Berry, Eric Blake, and Ralf Wildenhues.
* Split large sed scripts, for HP-UX sed.Bruno Haible2011-02-091-1/+2
| | | | | | | | | | | * modules/math (Makefile.am): Split sed scripts around 50 sed commands, to avoid HP-UX limit of 99 commands, in the near future. * modules/stdlib (Makefile.am): Likewise. * modules/unistd (Makefile.am): Likewise. * modules/wchar (Makefile.am): Likewise. Reported by Albert Chin <bug-gnulib@mlists.thewrittenword.com>. Suggestion by Ralf Wildenhues <Ralf.Wildenhues@gmx.de> in <http://lists.gnu.org/archive/html/bug-gnulib/2010-01/msg00216.html>.