diff options
author | Christian Biesinger <cbiesinger@google.com> | 2019-11-16 23:37:06 -0600 |
---|---|---|
committer | Christian Biesinger <cbiesinger@google.com> | 2019-12-16 12:20:50 -0600 |
commit | c0c3707ff46ccfb78ea175dd42d628d8c90dca8b (patch) | |
tree | 87568803633a4c9aeccb19f3db5705e037fa8985 /gnulib/import/unistd.in.h | |
parent | f81e7e2db6d1aaf47561e54356aee12b585533c2 (diff) | |
download | gdb-c0c3707ff46ccfb78ea175dd42d628d8c90dca8b.zip gdb-c0c3707ff46ccfb78ea175dd42d628d8c90dca8b.tar.gz gdb-c0c3707ff46ccfb78ea175dd42d628d8c90dca8b.tar.bz2 |
Update Gnulib to the latest git version
This patch allows us to remove a workaround in common-defs.h due to
the gnulib fix in:
https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00024.html
All of GDB's local Gnulib patches were already fixed upstream per their
descriptions, so this patch removes them all.
The problem listed here:
https://sourceware.org/ml/gdb-patches/2019-08/msg00553.html
was probably partially fixed by moving gnulib to the toplevel;
for the remainder, I am setting MAKEOVERRIDES to empty in
gnulib/Makefile.am. See also the comment there (it fixes an issue
with compilers that don't use C99/C11 by default such as GCC 4.8.5,
the default on Centos 7).
gdb/ChangeLog:
2019-12-16 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/common-defs.h: Remove workaround for a gnulib bug
(we no longer need to include time.h before pathmax.h)
gnulib/ChangeLog:
2019-12-16 Christian Biesinger <cbiesinger@google.com>
* Makefile.am: Set MAKEOVERRIDES.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
* import/Makefile.am: Update.
* import/Makefile.in: Regenerate.
* import/_Noreturn.h: New file.
* import/alloca.c (i00afunc): Update.
* import/alloca.in.h (if): Update.
* import/arg-nonnull.h: Rename from import/extra/snippet/arg-nonnull.h.
* import/arpa_inet.in.h (if): Update.
* import/assure.h: Update.
* import/at-func.c: Update.
* import/basename-lgpl.c: Update.
* import/canonicalize-lgpl.c (if): Update.
* import/c++defs.h: Rename from import/extra/snippet/c++defs.h.
* import/cdefs.h: New file.
* import/chdir-long.c: Update.
* import/chdir-long.h: Update.
* import/cloexec.c: Update.
* import/cloexec.h: Update.
* import/close.c: Update.
* import/closedir.c: Update.
* import/config.charset: Remove.
* import/dirent-private.h: Update.
* import/dirent.in.h: Update.
* import/dirfd.c: Update.
* import/dirname-lgpl.c: Update.
* import/dirname.h (base_name): Update.
* import/dosname.h (if): Update.
* import/dup-safer-flag.c: New file.
* import/dup-safer.c: Update.
* import/dup.c: Update.
* import/dup2.c (if): Update.
(dup2_nothrow): Update.
(ms_windows_dup2): Update.
* import/errno.in.h (if): Update.
(elif): Update.
* import/error.c (if): Update.
(strerror_r): Update.
(program_name): Update.
(error): Update.
(error_at_line): Update.
* import/error.h: Update.
* import/exitfail.c: Update.
* import/exitfail.h: Update.
* import/extra/config.rpath: Update.
* import/extra/snippet/_Noreturn.h: Remove.
* import/extra/update-copyright: Update.
* import/fchdir.c: Update.
* import/fcntl.c (rpl_fcntl): Update.
(INCL_DOS): Update.
(if): Update.
(rpl_fcntl_DUPFD): Update.
(rpl_fcntl_DUPFD_CLOEXEC): Update.
(klibc_fcntl): Update.
(fcntl): Update.
(have_dupfd_cloexec): Update.
* import/fcntl.in.h (if): Update.
(creat): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
(O_CLOEXEC): Update.
(GNULIB_defined_O_CLOEXEC): Update.
* import/fd-hook.c: Update.
* import/fd-hook.h: Update.
* import/fd-safer-flag.c: New file.
* import/fd-safer.c: Update.
* import/fdopendir.c: Update.
* import/filename.h: Update.
* import/filenamecat-lgpl.c (longest_relative_suffix): Update.
(mfile_name_concat): Update.
* import/filenamecat.h: Update.
* import/flexmember.h: Update.
* import/float+.h: Update.
* import/float.c: Update.
* import/float.in.h (LDBL_MIN): Update.
* import/fnmatch.c (__builtin_expect): Update.
(FALLTHROUGH): Update.
* import/fnmatch.in.h (_FNMATCH_H): Update.
(_): Update.
(fnmatch): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
* import/fnmatch_loop.c (FCT): Update.
(EXT): Update.
* import/fpucw.h (GET_FPUCW): Update.
(SET_FPUCW): Update.
* import/frexp.c: Update.
* import/frexpl.c: Update.
* import/fstat.c (stat): Update.
(fstat): Update.
(WINDOWS_NATIVE): Update.
(fstat_nothrow): Update.
(WIN32_LEAN_AND_MEAN): Update.
* import/fstatat.c (normal_fstatat): Update.
(rpl_fstatat): Update.
* import/getcwd-lgpl.c (rpl_getcwd): Update.
* import/getcwd.c (getcwd_nothrow): Update.
(getcwd_system): Update.
(__getcwd): Update.
* import/getdtablesize.c (if): Update.
(_setmaxstdio): Update.
(_setmaxstdio_nothrow): Update.
(getdtablesize): Update.
* import/getlogin_r.c (if): Update.
(getlogin_r): Update.
* import/getprogname.c (getprogname): Update.
* import/getprogname.h: Update.
* import/gettext.h (if): Update.
* import/gettimeofday.c (WINDOWS_NATIVE): Update.
(localtime): Update.
(GetProcAddress): Update.
(gmtime): Update.
(void): Update.
(struct tm): Update.
(rpl_localtime): Update.
(initialize): Update.
(rpl_gmtime): Update.
(tzset): Update.
(rpl_tzset): Update.
* import/glob-libc.h (_Restrict_): Update.
(__size_t): Update.
(__need_size_t): Update.
(glob): Update.
(globfree): Update.
(__REDIRECT_NTH): Update.
(glob64): Update.
(globfree64): Update.
(glob_pattern_p): Update.
* import/glob.c (POSIX): Update.
(if): Update.
(__set_errno): Update.
(getpwnam_r): Update.
(__lstat64): Update.
(FLEXIBLE_ARRAY_MEMBER): Update.
(__glob_pattern_p): Update.
(GETPW_R_SIZE_MAX): Update.
(GET_LOGIN_NAME_MAX): Update.
(DT_UNKNOWN): Update.
(DT_DIR): Update.
(DT_LNK): Update.
(D_TYPE_TO_RESULT): Update.
(readdir_result_might_be_symlink): Update.
(readdir_result_might_be_dir): Update.
(readdir_result_type): Update.
(D_INO_TO_RESULT): Update.
(READDIR_RESULT_INITIALIZER): Update.
(attribute_hidden): Update.
(__attribute_noinline__): Update.
(__builtin_expect): Update.
(__glibc_unlikely): Update.
(__has_builtin): Update.
(__glob_pattern_type): Update.
(is_dir): Update.
(glob): Update.
(globfree): Update.
(libc_hidden_def): Update.
(DIRSEP_CHAR): Update.
(prefix_array): Update.
(weak_alias): Update.
(link_exists2_p): Update.
(link_exists_p): Update.
(glob_in_dir): Update.
(GLOBNAMES_MEMBERS): Update.
* import/glob.in.h (_GL_GLOB_H): Update.
(_): Update.
(__BEGIN_DECLS): Update.
(__END_DECLS): Update.
(_Restrict_): Update.
(__THROW): Update.
(__THROWNL): Update.
(__size_t): Update.
(__USE_GNU): Update.
(glob): Update.
(globfree): Update.
(glob_pattern_p): Update.
(__glob_pattern_p): Update.
(__GLOB_GNULIB): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_WARN_ON_USE): Update.
* import/glob_internal.h: New file.
* import/glob_pattern_p.c: New file.
* import/globfree.c: New file.
* import/glthread/lock.c (glthread_rwlock_init_for_glibc): Update.
(glthread_rwlock_rdlock_multithreaded): Update.
(glthread_once_call): Update.
(glthread_once_multithreaded): Update.
(glthread_once_singlethreaded): Update.
(glthread_recursive_lock_init_multithreaded): Update.
(glthread_recursive_lock_lock_multithreaded): Update.
(glthread_recursive_lock_unlock_multithreaded): Update.
(glthread_recursive_lock_destroy_multithreaded): Update.
(glthread_lock_init_func): Update.
(glthread_lock_lock_func): Update.
(glthread_lock_unlock_func): Update.
(glthread_lock_destroy_func): Update.
(gl_waitqueue_t): Update.
(gl_waitqueue_init): Update.
(gl_waitqueue_add): Update.
(gl_waitqueue_notify_first): Update.
(gl_waitqueue_notify_all): Update.
(glthread_rwlock_init_func): Update.
(glthread_rwlock_rdlock_func): Update.
(glthread_rwlock_wrlock_func): Update.
(glthread_rwlock_unlock_func): Update.
(glthread_rwlock_destroy_func): Update.
(glthread_recursive_lock_init_func): Update.
(glthread_recursive_lock_lock_func): Update.
(glthread_recursive_lock_unlock_func): Update.
(glthread_recursive_lock_destroy_func): Update.
(glthread_once_func): Update.
* import/glthread/lock.h (c11_threads_in_use): Update.
(pthread_in_use): Update.
(gl_rwlock_initializer): Update.
(glthread_rwlock_init): Update.
(glthread_rwlock_init_for_glibc): Update.
(pth_in_use): Update.
(gl_lock_define): Update.
(gl_lock_define_initialized): Update.
(gl_lock_initializer): Update.
(glthread_lock_init): Update.
(glthread_lock_lock): Update.
(glthread_lock_unlock): Update.
(glthread_lock_destroy): Update.
(gl_rwlock_define): Update.
(gl_rwlock_define_initialized): Update.
(glthread_rwlock_rdlock): Update.
(glthread_rwlock_wrlock): Update.
(glthread_rwlock_unlock): Update.
(glthread_rwlock_destroy): Update.
(gl_recursive_lock_define): Update.
(gl_recursive_lock_define_initialized): Update.
(gl_recursive_lock_initializer): Update.
(glthread_recursive_lock_init): Update.
(glthread_recursive_lock_lock): Update.
(glthread_recursive_lock_unlock): Update.
(glthread_recursive_lock_destroy): Update.
(gl_once_define): Update.
(glthread_once): Update.
(glthread_once_multithreaded): Update.
(glthread_once_singlethreaded): Update.
(thread_in_use): Update.
(glthread_recursive_lock_init_multithreaded): Update.
(glthread_recursive_lock_lock_multithreaded): Update.
(glthread_recursive_lock_unlock_multithreaded): Update.
(glthread_recursive_lock_destroy_multithreaded): Update.
(glthread_lock_init_func): Update.
(glthread_lock_lock_func): Update.
(glthread_lock_unlock_func): Update.
(glthread_lock_destroy_func): Update.
(glthread_rwlock_init_func): Update.
(glthread_rwlock_rdlock_func): Update.
(glthread_rwlock_wrlock_func): Update.
(glthread_rwlock_unlock_func): Update.
(glthread_rwlock_destroy_func): Update.
(glthread_recursive_lock_init_func): Update.
(glthread_recursive_lock_lock_func): Update.
(glthread_recursive_lock_unlock_func): Update.
(glthread_recursive_lock_destroy_func): Update.
(glthread_once_func): Update.
* import/glthread/threadlib.c: Update.
* import/hard-locale.c: Update.
* import/hard-locale.h: Update.
* import/inet_ntop.c: Update.
* import/intprops.h (__has_builtin): Update.
(_GL_INT_CONVERT): Update.
(_GL_INT_NEGATE_CONVERT): Update.
(verify): Update.
(_GL_HAS_BUILTIN_OVERFLOW): Update.
(_GL_HAS_BUILTIN_ADD_OVERFLOW): Update.
(_GL_HAS_BUILTIN_OVERFLOW_P): Update.
(_GL_HAS_BUILTIN_MUL_OVERFLOW): Update.
(_GL_BINARY_OP_OVERFLOW): Update.
(INT_ADD_WRAPV): Update.
(INT_SUBTRACT_WRAPV): Update.
(INT_MULTIPLY_WRAPV): Update.
(_GL_INT_OP_WRAPV): Update.
(_GL_INT_OP_WRAPV_SMALLISH): Update.
(_GL_INT_OP_WRAPV_LONGISH): Update.
(_GL_INT_OP_CALC): Update.
(_GL_INT_OP_CALC1): Update.
(_GL_INT_OP_WRAPV_VIA_UNSIGNED): Update.
(_GL_INT_ADD_RANGE_OVERFLOW): Update.
(_GL_INT_SUBTRACT_RANGE_OVERFLOW): Update.
(_GL_INT_MULTIPLY_RANGE_OVERFLOW): Update.
* import/inttypes.in.h (if): Update.
* import/isnan.c: Update.
* import/isnand-nolibm.h: Update.
* import/isnand.c: Update.
* import/isnanl-nolibm.h: Update.
* import/isnanl.c: Update.
* import/itold.c: Update.
* import/libc-config.h: New file.
* import/limits.in.h (LLONG_MIN): Update.
(LLONG_MAX): Update.
(ULLONG_MAX): Update.
(WORD_BIT): Update.
(LONG_BIT): Update.
* import/localcharset.c (setlocale): Update.
(relocate): Update.
(O_NOFOLLOW): Update.
(ISSLASH): Update.
(DIRECTORY_SEPARATOR): Update.
(getc): Update.
(volatile): Update.
(get_charset_aliases): Update.
(struct table_entry): Update.
(alias_table_defined): Update.
(locale_table_defined): Update.
(locale_charset): Update.
(if): Update.
* import/localcharset.h: Update.
* import/localtime-buffer.c: New file.
* import/localtime-buffer.h: New file.
* import/lstat.c (rpl_lstat): Update.
* import/m4/00gnulib.m4: Update.
* import/m4/__inline.m4: New file.
* import/m4/absolute-header.m4: Update.
* import/m4/alloca.m4: Update.
* import/m4/arpa_inet_h.m4: Update.
* import/m4/builtin-expect.m4: New file.
* import/m4/canonicalize.m4: Update.
* import/m4/chdir-long.m4: Update.
* import/m4/close.m4: Update.
* import/m4/closedir.m4: Update.
* import/m4/codeset.m4: Update.
* import/m4/configmake.m4: Remove.
* import/m4/d-ino.m4: Update.
* import/m4/d-type.m4: Update.
* import/m4/dirent_h.m4: Update.
* import/m4/dirfd.m4: Update.
* import/m4/dirname.m4: Update.
* import/m4/double-slash-root.m4: Update.
* import/m4/dup.m4: Update.
* import/m4/dup2.m4: Update.
* import/m4/eealloc.m4: Update.
* import/m4/environ.m4: Update.
* import/m4/errno_h.m4: Update.
* import/m4/error.m4: Update.
* import/m4/exponentd.m4: Update.
* import/m4/exponentl.m4: Update.
* import/m4/extensions.m4: Update.
* import/m4/extern-inline.m4: Update.
* import/m4/fchdir.m4: Update.
* import/m4/fcntl-o.m4: Update.
* import/m4/fcntl.m4: Update.
* import/m4/fcntl_h.m4: Update.
* import/m4/fdopendir.m4: Update.
* import/m4/filenamecat.m4: Update.
* import/m4/flexmember.m4: Update.
* import/m4/float_h.m4: Update.
* import/m4/fnmatch.m4: Update.
* import/m4/fnmatch_h.m4: New file.
* import/m4/fpieee.m4: Update.
* import/m4/frexp.m4: Update.
* import/m4/frexpl.m4: Update.
* import/m4/fstat.m4: Update.
* import/m4/fstatat.m4: Update.
* import/m4/getcwd-abort-bug.m4: Update.
* import/m4/getcwd-path-max.m4: Update.
* import/m4/getcwd.m4: Update.
* import/m4/getdtablesize.m4: Update.
* import/m4/getlogin.m4: New file.
* import/m4/getlogin_r.m4: Update.
* import/m4/getpagesize.m4: New file.
* import/m4/getprogname.m4: Update.
* import/m4/gettimeofday.m4: Update.
* import/m4/glibc21.m4: Remove.
* import/m4/glob.m4: Update.
* import/m4/glob_h.m4: New file.
* import/m4/gnulib-cache.m4: Update.
* import/m4/gnulib-common.m4: Update.
* import/m4/gnulib-comp.m4: Update.
* import/m4/gnulib-tool.m4: Update.
* import/m4/hard-locale.m4: Remove.
* import/m4/host-cpu-c-abi.m4: New file.
* import/m4/include_next.m4: Update.
* import/m4/inet_ntop.m4: Update.
* import/m4/inttypes-pri.m4: Update.
* import/m4/inttypes.m4: Update.
* import/m4/isnand.m4: Update.
* import/m4/isnanl.m4: Update.
* import/m4/largefile.m4: Update.
* import/m4/lib-ld.m4: Update.
* import/m4/lib-link.m4: Update.
* import/m4/lib-prefix.m4: Update.
* import/m4/limits-h.m4: Update.
* import/m4/localcharset.m4: Update.
* import/m4/locale-fr.m4: Update.
* import/m4/locale-ja.m4: Update.
* import/m4/locale-zh.m4: Update.
* import/m4/localtime-buffer.m4: New file.
* import/m4/lock.m4: Update.
* import/m4/longlong.m4: Update.
* import/m4/lstat.m4: Update.
* import/m4/malloc.m4: Update.
* import/m4/malloca.m4: Update.
* import/m4/math_h.m4: Update.
* import/m4/mbrtowc.m4: Update.
* import/m4/mbsinit.m4: Update.
* import/m4/mbsrtowcs.m4: Update.
* import/m4/mbstate_t.m4: Update.
* import/m4/memchr.m4: Update.
* import/m4/memmem.m4: Update.
* import/m4/mempcpy.m4: Update.
* import/m4/memrchr.m4: Update.
* import/m4/mkdir.m4: Update.
* import/m4/mkdtemp.m4: Update.
* import/m4/mkostemp.m4: Update.
* import/m4/mmap-anon.m4: Update.
* import/m4/mode_t.m4: Update.
* import/m4/msvc-inval.m4: Update.
* import/m4/msvc-nothrow.m4: Update.
* import/m4/multiarch.m4: Update.
* import/m4/netinet_in_h.m4: Update.
* import/m4/nocrash.m4: Update.
* import/m4/off_t.m4: Update.
* import/m4/onceonly.m4: Remove.
* import/m4/open-cloexec.m4: New file.
* import/m4/open-slash.m4: New file.
* import/m4/open.m4: Update.
* import/m4/openat.m4: Update.
* import/m4/opendir.m4: Update.
* import/m4/pathmax.m4: Update.
* import/m4/pthread_rwlock_rdlock.m4: New file.
* import/m4/rawmemchr.m4: Update.
* import/m4/readdir.m4: Update.
* import/m4/readlink.m4: Update.
* import/m4/realloc.m4: Update.
* import/m4/rename.m4: Update.
* import/m4/rewinddir.m4: Update.
* import/m4/rmdir.m4: Update.
* import/m4/save-cwd.m4: Update.
* import/m4/secure_getenv.m4: Remove.
* import/m4/setenv.m4: Update.
* import/m4/signal_h.m4: Update.
* import/m4/socklen.m4: Update.
* import/m4/sockpfaf.m4: Update.
* import/m4/ssize_t.m4: Update.
* import/m4/stat-time.m4: New file.
* import/m4/stat.m4: Update.
* import/m4/std-gnu11.m4: New file.
* import/m4/stdalign.m4: Update.
* import/m4/stdbool.m4: Update.
* import/m4/stddef_h.m4: Update.
* import/m4/stdint.m4: Update.
* import/m4/stdio_h.m4: Update.
* import/m4/stdlib_h.m4: Update.
* import/m4/strchrnul.m4: Update.
* import/m4/strdup.m4: Update.
* import/m4/strerror.m4: Update.
* import/m4/strerror_r.m4: Update.
* import/m4/string_h.m4: Update.
* import/m4/strstr.m4: Update.
* import/m4/strtok_r.m4: Update.
* import/m4/sys_socket_h.m4: Update.
* import/m4/sys_stat_h.m4: Update.
* import/m4/sys_time_h.m4: Update.
* import/m4/sys_types_h.m4: Update.
* import/m4/sys_uio_h.m4: Update.
* import/m4/tempname.m4: Update.
* import/m4/threadlib.m4: Update.
* import/m4/time_h.m4: Update.
* import/m4/time_r.m4: Update.
* import/m4/unistd-safer.m4: Update.
* import/m4/unistd_h.m4: Update.
* import/m4/warn-on-use.m4: Update.
* import/m4/wchar_h.m4: Update.
* import/m4/wchar_t.m4: Update.
* import/m4/wctype_h.m4: Update.
* import/m4/wint_t.m4: Update.
* import/malloc.c: Update.
* import/malloc/scratch_buffer.h: New file.
* import/malloc/scratch_buffer_grow.c: New file.
* import/malloc/scratch_buffer_grow_preserve.c: New file.
* import/malloc/scratch_buffer_set_array_size.c: New file.
* import/malloca.c (MAGIC_NUMBER): Update.
(MAGIC_SIZE): Update.
(struct preliminary_header): Update.
(HEADER_SIZE): Update.
(union header): Update.
(verify): Update.
(HASH_TABLE_SIZE): Update.
(freea): Update.
* import/malloca.h (malloca): Update.
(nmalloca): Update.
* import/malloca.valgrind: Remove.
* import/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Update.
(func): Update.
(rpl_func): Update.
(f): Update.
(d): Update.
(l): Update.
(_GL_WARN_ON_USE): Update.
(_GL_WARN_ON_USE_ATTRIBUTE): Update.
(FP_ILOGB0): Update.
(FP_ILOGBNAN): Update.
(acosf): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(asinf): Update.
(atanf): Update.
(atan2f): Update.
(cosf): Update.
(coshf): Update.
(expf): Update.
(expl): Update.
(expm1l): Update.
(ilogbl): Update.
(rintl): Update.
(sinf): Update.
(sinhf): Update.
(sqrtf): Update.
(tanf): Update.
(tanhf): Update.
(isfinite): Update.
(isinf): Update.
(isnan): Update.
(GNULIB_defined_signbit): Update.
(signbit): Update.
* import/mbrtowc.c (FALLTHROUGH): Update.
(locale_enc): Update.
(locale_enc_cached): Update.
(gl_lock_define_initialized): Update.
(mbrtowc): Update.
* import/mbsinit.c (if): Update.
(mbsinit): Update.
* import/mbsrtowcs-impl.h: Update.
* import/mbsrtowcs-state.c: Update.
* import/mbsrtowcs.c: Update.
* import/memchr.c: Update.
* import/memchr.valgrind: Update.
* import/memmem.c (__builtin_expect): Update.
* import/mempcpy.c: Update.
* import/memrchr.c (__memrchr): Update.
* import/mkdir.c (if): Update.
* import/mkdtemp.c: Update.
* import/mkostemp.c: Update.
* import/msvc-inval.c: Update.
* import/msvc-inval.h: Update.
* import/msvc-nothrow.c: Update.
* import/msvc-nothrow.h (if): Update.
* import/netinet_in.in.h: Update.
* import/open.c (open): Update.
(if): Update.
* import/openat-die.c: Update.
* import/openat-priv.h: Update.
* import/openat-proc.c: Update.
* import/openat.c (rpl_openat): Update.
* import/openat.h: Update.
* import/opendir.c: Update.
* import/pathmax.h (if): Update.
* import/pipe-safer.c: Update.
* import/rawmemchr.c: Update.
* import/rawmemchr.valgrind: Update.
* import/readdir.c (readdir): Update.
* import/readlink.c: Update.
* import/realloc.c: Update.
* import/ref-add.sin: Remove.
* import/ref-del.sin: Remove.
* import/rename.c (if): Update.
* import/rewinddir.c: Update.
* import/rmdir.c: Update.
* import/same-inode.h (SAME_INODE): Update.
* import/save-cwd.c (save_cwd): Update.
* import/save-cwd.h: Update.
* import/scratch_buffer.h: New file.
* import/secure_getenv.c: Remove.
* import/setenv.c: Update.
* import/signal.in.h: Update.
* import/stat-time.c: New file.
* import/stat-time.h: New file.
* import/stat-w32.c: New file.
* import/stat-w32.h: New file.
* import/stat.c (if): Update.
(stat): Update.
(REPLACE_FUNC_STAT_DIR): Update.
(WINDOWS_NATIVE): Update.
(WIN32_LEAN_AND_MEAN): Update.
(is_unc_root): Update.
(rpl_stat): Update.
* import/stdalign.in.h (elif): Update.
* import/stdbool.in.h: Update.
* import/stddef.in.h (_GL_STDDEF_ALIGNAS): Update.
(max_align_t): Update.
(GNULIB_defined_max_align_t): Update.
* import/stdint.in.h (WINT_MIN): Update.
(WINT_MAX): Update.
(_STDINT_MIN): Update.
(_STDINT_UNSIGNED_MIN): Update.
(_STDINT_SIGNED_MIN): Update.
(PTRDIFF_MIN): Update.
(SIG_ATOMIC_MIN): Update.
(WCHAR_MIN): Update.
* import/stdio.in.h (if): Update.
* import/stdlib.in.h (if): Update.
(_GL_WARN_ON_USE): Update.
(_GL_FUNCDECL_SYS): Update.
(random): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(srandom): Update.
(initstate): Update.
(setstate): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(GNULIB_defined_strtod_function): Update.
(strtold): Update.
(GNULIB_defined_strtold_function): Update.
* import/str-two-way.h: Update.
* import/strchrnul.c: Update.
* import/strchrnul.valgrind: Update.
* import/strdup.c: Update.
* import/streq.h: Update.
* import/strerror-override.c: Update.
* import/strerror-override.h: Update.
* import/strerror.c (strerror): Update.
* import/strerror_r.c (safe_copy): Update.
* import/string.in.h (_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
* import/stripslash.c: Update.
* import/strnlen1.c: Update.
* import/strnlen1.h: Update.
* import/strstr.c (__builtin_expect): Update.
* import/strtok_r.c: Update.
* import/sys_socket.in.h (CMSG_SPACE): Update.
(CMSG_LEN): Update.
(struct sockaddr_storage): Update.
(SO_REUSEPORT): Update.
(_GL_WARN_ON_USE): Update.
* import/sys_stat.in.h (if): Update.
(stat): Update.
(struct stat): Update.
(st_atime): Update.
(st_mtime): Update.
(st_ctime): Update.
(_GL_WINDOWS_STAT_TIMESPEC): Update.
(GNULIB_defined_struct_stat): Update.
(_S_IFBLK): Update.
(_S_IFLNK): Update.
(_S_IFSOCK): Update.
(fstat): Update.
(fstatat): Update.
(lstat): Update.
(stat64): Update.
(_stat64): Update.
(_stat32i64): Update.
(_stati64): Update.
(_stat32): Update.
(_stat64i32): Update.
* import/sys_time.in.h: Update.
* import/sys_types.in.h (dev_t): Update.
(GNULIB_defined_dev_t): Update.
(ino_t): Update.
(GNULIB_defined_ino_t): Update.
(_GL_WINDOWS_STAT_INODES): Update.
(if): Update.
* import/sys_uio.in.h: Update.
* import/tempname.c (__secure_getenv): Update.
(try_nocreate): Update.
* import/tempname.h: Update.
* import/time.in.h (tzset): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(ctime): Update.
(strftime): Update.
* import/time_r.c: Update.
* import/unistd--.h: Update.
* import/unistd-safer.h: Update.
* import/unistd.in.h (if): Update.
(elif): Update.
(__need_getopt): Update.
(access): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
(_GL_FUNCDECL_SYS): Update.
(__declspec): Update.
(_GL_WARN_ON_USE_ATTRIBUTE): Update.
(faccessat): Update.
(getpass): Update.
(truncate): Update.
* import/unsetenv.c: Update.
* import/verify.h (if): Update.
(_GL_HAVE__STATIC_ASSERT): Update.
(_GL_HAVE_STATIC_ASSERT): Update.
(_GL_HAVE__STATIC_ASSERT1): Update.
(_GL_HAVE_STATIC_ASSERT1): Update.
(_GL_VERIFY): Update.
(_Static_assert): Update.
(_GL_HAS_BUILTIN_TRAP): Update.
(_GL_HAS_BUILTIN_UNREACHABLE): Update.
(verify_true): Update.
(verify): Update.
(__has_builtin): Update.
(elif): Update.
(assume): Update.
* import/warn-on-use.h: Rename from import/extra/snippet/warn-on-use.h.
* import/wchar.in.h (if): Update.
(wcsftime): Update.
(_GL_FUNCDECL_RPL): Update.
(_GL_CXXALIAS_RPL): Update.
(_GL_FUNCDECL_SYS): Update.
(_GL_CXXALIAS_SYS): Update.
(_GL_CXXALIASWARN): Update.
(_GL_WARN_ON_USE): Update.
* import/wctype.in.h (rpl_iswalnum): Update.
(rpl_iswalpha): Update.
(rpl_iswblank): Update.
(rpl_iswcntrl): Update.
(rpl_iswdigit): Update.
(rpl_iswgraph): Update.
(rpl_iswlower): Update.
(rpl_iswprint): Update.
(rpl_iswpunct): Update.
(rpl_iswspace): Update.
(rpl_iswupper): Update.
(rpl_iswxdigit): Update.
(rpl_towlower): Update.
(rpl_towupper): Update.
(iswalnum): Update.
(iswalpha): Update.
(iswblank): Update.
(iswcntrl): Update.
(iswdigit): Update.
(iswgraph): Update.
(iswlower): Update.
(iswprint): Update.
(iswpunct): Update.
(iswspace): Update.
(iswupper): Update.
(iswxdigit): Update.
(towlower): Update.
(towupper): Update.
* import/windows-initguard.h: New file.
* import/windows-mutex.c: New file.
* import/windows-mutex.h: New file.
* import/windows-once.c: New file.
* import/windows-once.h: New file.
* import/windows-recmutex.c: New file.
* import/windows-recmutex.h: New file.
* import/windows-rwlock.c: New file.
* import/windows-rwlock.h: New file.
* import/xalloc-oversized.h: New file.
* patches/0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch: Remove.
* patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch: Remove.
* patches/0003-Fix-glob-c-Coverity-issues.patch: Remove.
* update-gnulib.sh: Update to latest gnulib and don't apply patches
anymore. Also updates the patch -p flag to the current directory structure in
case patches are needed again in the future.
Change-Id: I9c2b07a3046baecfb664e21b2644353ea888dbfa
Diffstat (limited to 'gnulib/import/unistd.in.h')
-rw-r--r-- | gnulib/import/unistd.in.h | 249 |
1 files changed, 191 insertions, 58 deletions
diff --git a/gnulib/import/unistd.in.h b/gnulib/import/unistd.in.h index c3af07a..48db46a 100644 --- a/gnulib/import/unistd.in.h +++ b/gnulib/import/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around <unistd.h>. - Copyright (C) 2003-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. */ + along with this program; if not, see <https://www.gnu.org/licenses/>. */ #ifndef _@GUARD_PREFIX@_UNISTD_H @@ -21,7 +21,7 @@ #endif @PRAGMA_COLUMNS@ -#ifdef _GL_INCLUDING_UNISTD_H +#if @HAVE_UNISTD_H@ && defined _GL_INCLUDING_UNISTD_H /* Special invocation convention: - On Mac OS X 10.3.9 we have a sequence of nested includes <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h> @@ -52,21 +52,30 @@ #define _@GUARD_PREFIX@_UNISTD_H /* NetBSD 5.0 mis-defines NULL. Also get size_t. */ -#include <stddef.h> +/* But avoid namespace pollution on glibc systems. */ +#ifndef __GLIBC__ +# include <stddef.h> +#endif /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */ +/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include + it before we #define unlink rpl_unlink. */ /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */ /* But avoid namespace pollution on glibc systems. */ #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \ + || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \ + && (defined _WIN32 && ! defined __CYGWIN__)) \ || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \ && defined __CYGWIN__)) \ && ! defined __GLIBC__ # include <stdio.h> #endif -/* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>. */ +/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in + <unistd.h>. */ /* But avoid namespace pollution on glibc systems. */ -#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \ +#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \ + && (defined __CYGWIN__ || defined __ANDROID__) \ && ! defined __GLIBC__ # include <fcntl.h> #endif @@ -90,13 +99,13 @@ lseek(), read(), unlink(), write() in <io.h>. */ #if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \ || defined GNULIB_POSIXCHECK) \ - && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) + && (defined _WIN32 && ! defined __CYGWIN__)) # include <io.h> /* mingw32, mingw64 */ # include <direct.h> /* mingw64, MSVC 9 */ #elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \ || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \ || defined GNULIB_POSIXCHECK) \ - && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) + && (defined _WIN32 && ! defined __CYGWIN__) # include <io.h> #endif @@ -109,25 +118,32 @@ # include <netdb.h> #endif +/* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>. */ +/* But avoid namespace pollution on glibc systems. */ +#if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \ + && !defined __GLIBC__ +# include <sys/stat.h> +#endif + /* MSVC defines off_t in <sys/types.h>. May also define off_t to a 64-bit type on native Windows. */ -#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@ -/* Get off_t. */ +/* But avoid namespace pollution on glibc systems. */ +#ifndef __GLIBC__ +/* Get off_t, ssize_t. */ # include <sys/types.h> #endif -#if (@GNULIB_READ@ || @GNULIB_WRITE@ \ - || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ - || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK) -/* Get ssize_t. */ -# include <sys/types.h> -#endif +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ -/* Get getopt(), optarg, optind, opterr, optopt. - But avoid namespace pollution on glibc systems. */ -#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT -# define __need_getopt -# include <getopt.h> +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Get getopt(), optarg, optind, opterr, optopt. */ +#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT +# include <getopt-cdefs.h> +# include <getopt-pfx-core.h> #endif #ifndef _GL_INLINE_HEADER_BEGIN @@ -138,13 +154,6 @@ _GL_INLINE_HEADER_BEGIN # define _GL_UNISTD_INLINE _GL_INLINE #endif -/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ - -/* The definition of _GL_ARG_NONNULL is copied here. */ - -/* The definition of _GL_WARN_ON_USE is copied here. */ - - /* Hide some function declarations from <winsock2.h>. */ #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ @@ -244,10 +253,28 @@ _GL_INLINE_HEADER_BEGIN /* Declare overridden functions. */ -#if defined GNULIB_POSIXCHECK +#if @GNULIB_ACCESS@ +# if @REPLACE_ACCESS@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef access +# define access rpl_access +# endif +_GL_FUNCDECL_RPL (access, int, (const char *file, int mode) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); +# else +_GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); +# endif +_GL_CXXALIASWARN (access); +#elif defined GNULIB_POSIXCHECK +# undef access +# if HAVE_RAW_DECL_ACCESS /* The access() function is a security risk. */ -_GL_WARN_ON_USE (access, "the access function is a security risk - " +_GL_WARN_ON_USE (access, "access does not always support X_OK - " + "use gnulib module access for portability; " + "also, this function is a security risk - " "use the gnulib module faccessat instead"); +# endif #endif @@ -268,7 +295,7 @@ _GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " to GID (if GID is not -1). Follow symbolic links. Return 0 if successful, otherwise -1 and errno set. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */ # if @REPLACE_CHOWN@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef chown @@ -319,6 +346,24 @@ _GL_WARN_ON_USE (close, "close does not portably work on sockets - " #endif +#if @GNULIB_COPY_FILE_RANGE@ +# if !@HAVE_COPY_FILE_RANGE@ +_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, + int ofd, off_t *opos, + size_t len, unsigned flags)); +_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, + int ofd, off_t *opos, + size_t len, unsigned flags)); +# endif +_GL_CXXALIASWARN (copy_file_range); +#elif defined GNULIB_POSIXCHECK +/* Assume copy_file_range is always declared. */ +_GL_WARN_ON_USE (copy_file_range, + "copy_file_range is unportable - " + "use gnulib module copy_file_range for portability"); +#endif + + #if @GNULIB_DUP@ # if @REPLACE_DUP@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -344,7 +389,7 @@ _GL_WARN_ON_USE (dup, "dup is unportable - " NEWFD = OLDFD, otherwise close NEWFD first if it is open. Return newfd if successful, otherwise -1 and errno set. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */ # if @REPLACE_DUP2@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define dup2 rpl_dup2 @@ -375,7 +420,7 @@ _GL_WARN_ON_USE (dup2, "dup2 is unportable - " Close NEWFD first if it is open. Return newfd if successful, otherwise -1 and errno set. See the Linux man page at - <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */ + <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */ # if @HAVE_DUP3@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define dup3 rpl_dup3 @@ -397,6 +442,13 @@ _GL_WARN_ON_USE (dup3, "dup3 is unportable - " #if @GNULIB_ENVIRON@ +# if defined __CYGWIN__ && !defined __i386__ +/* The 'environ' variable is defined in a DLL. Therefore its declaration needs + the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it. + This leads to a link error on 64-bit Cygwin when the option + -Wl,--disable-auto-import is in use. */ +_GL_EXTERN_C __declspec(dllimport) char **environ; +# endif # if !@HAVE_DECL_ENVIRON@ /* Set of environment variables and values. An array of strings of the form "VARIABLE=VALUE", terminated with a NULL. */ @@ -422,12 +474,12 @@ extern char **environ; #elif defined GNULIB_POSIXCHECK # if HAVE_RAW_DECL_ENVIRON _GL_UNISTD_INLINE char *** +_GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - " + "use gnulib module environ for portability") rpl_environ (void) { return &environ; } -_GL_WARN_ON_USE (rpl_environ, "environ is unportable - " - "use gnulib module environ for portability"); # undef environ # define environ (*rpl_environ ()) # endif @@ -458,13 +510,25 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " #if @GNULIB_FACCESSAT@ -# if !@HAVE_FACCESSAT@ +# if @REPLACE_FACCESSAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef faccessat +# define faccessat rpl_faccessat +# endif +_GL_FUNCDECL_RPL (faccessat, int, + (int fd, char const *name, int mode, int flag) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (faccessat, int, + (int fd, char const *name, int mode, int flag)); +# else +# if !@HAVE_FACCESSAT@ _GL_FUNCDECL_SYS (faccessat, int, (int fd, char const *file, int mode, int flag) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (faccessat, int, (int fd, char const *file, int mode, int flag)); +# endif _GL_CXXALIASWARN (faccessat); #elif defined GNULIB_POSIXCHECK # undef faccessat @@ -480,7 +544,7 @@ _GL_WARN_ON_USE (faccessat, "faccessat is not portable - " the given file descriptor is open. Return 0 if successful, otherwise -1 and errno set. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */ # if ! @HAVE_FCHDIR@ _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); @@ -541,7 +605,7 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " /* Synchronize changes to a file. Return 0 if successful, otherwise -1 and errno set. See POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */ # if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@ _GL_FUNCDECL_SYS (fdatasync, int, (int fd)); # endif @@ -560,7 +624,7 @@ _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - " /* Synchronize changes, including metadata, to a file. Return 0 if successful, otherwise -1 and errno set. See POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */ # if !@HAVE_FSYNC@ _GL_FUNCDECL_SYS (fsync, int, (int fd)); # endif @@ -579,7 +643,7 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - " /* Change the size of the file to which FD is opened to become equal to LENGTH. Return 0 if successful, otherwise -1 and errno set. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */ # if @REPLACE_FTRUNCATE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef ftruncate @@ -609,7 +673,7 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - " Return BUF if successful, or NULL if the directory couldn't be determined or SIZE was too small. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>. + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>. Additionally, the gnulib module 'getcwd' guarantees the following GNU extension: If BUF is NULL, an array is allocated with 'malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as @@ -685,7 +749,9 @@ _GL_CXXALIAS_RPL (getdtablesize, int, (void)); # if !@HAVE_GETDTABLESIZE@ _GL_FUNCDECL_SYS (getdtablesize, int, (void)); # endif -_GL_CXXALIAS_SYS (getdtablesize, int, (void)); +/* Need to cast, because on AIX, the parameter list is + (...). */ +_GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void)); # endif _GL_CXXALIASWARN (getdtablesize); #elif defined GNULIB_POSIXCHECK @@ -769,14 +835,14 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - " /* Returns the user's login name, or NULL if it cannot be found. Upon error, returns NULL with errno set. - See <http://www.opengroup.org/susv3xsh/getlogin.html>. + See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>. Most programs don't need to use this function, because the information is available through environment variables: ${LOGNAME-$USER} on Unix platforms, $USERNAME on native Windows platforms. */ -# if !@HAVE_GETLOGIN@ +# if !@HAVE_DECL_GETLOGIN@ _GL_FUNCDECL_SYS (getlogin, char *, (void)); # endif _GL_CXXALIAS_SYS (getlogin, char *, (void)); @@ -798,7 +864,7 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - " the case that the login name cannot be found but no specific error is provided (this case is hopefully rare but is left open by the POSIX spec). - See <http://www.opengroup.org/susv3xsh/getlogin.html>. + See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>. Most programs don't need to use this function, because the information is available through environment variables: @@ -839,6 +905,11 @@ _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - " _GL_FUNCDECL_RPL (getpagesize, int, (void)); _GL_CXXALIAS_RPL (getpagesize, int, (void)); # else +/* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if + the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */ +# if defined __hpux +_GL_FUNCDECL_SYS (getpagesize, int, (void)); +# endif # if !@HAVE_GETPAGESIZE@ # if !defined getpagesize /* This is for POSIX systems. */ @@ -913,6 +984,36 @@ _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - " #endif +#if @GNULIB_GETPASS@ +/* Function getpass() from module 'getpass': + Read a password from /dev/tty or stdin. + Function getpass() from module 'getpass-gnu': + Read a password of arbitrary length from /dev/tty or stdin. */ +# if @REPLACE_GETPASS@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getpass +# define getpass rpl_getpass +# endif +_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt)); +# else +# if !@HAVE_GETPASS@ +_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt)); +# endif +_GL_CXXALIASWARN (getpass); +#elif defined GNULIB_POSIXCHECK +# undef getpass +# if HAVE_RAW_DECL_GETPASS +_GL_WARN_ON_USE (getpass, "getpass is unportable - " + "use gnulib module getpass or getpass-gnu for portability"); +# endif +#endif + + #if @GNULIB_GETUSERSHELL@ /* Return the next valid login shell on the system, or NULL when the end of the list has been reached. */ @@ -1003,7 +1104,7 @@ _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " to GID (if GID is not -1). Do not follow symbolic links. Return 0 if successful, otherwise -1 and errno set. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */ # if @REPLACE_LCHOWN@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef lchown @@ -1033,7 +1134,7 @@ _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - " /* Create a new hard link for an existing file. Return 0 if successful, otherwise -1 and errno set. See POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */ # if @REPLACE_LINK@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define link rpl_link @@ -1099,7 +1200,7 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - " /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. Return the new offset if successful, otherwise -1 and errno set. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */ # if @REPLACE_LSEEK@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define lseek rpl_lseek @@ -1145,7 +1246,7 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - " Store the read-end as fd[0] and the write-end as fd[1]. Return 0 upon success, or -1 with errno set upon failure. See also the Linux man page at - <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */ + <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */ # if @HAVE_PIPE2@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define pipe2 rpl_pipe2 @@ -1171,7 +1272,7 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - " Return the number of bytes placed into BUF if successful, otherwise set errno and return -1. 0 indicates EOF. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */ # if @REPLACE_PREAD@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef pread @@ -1206,7 +1307,7 @@ _GL_WARN_ON_USE (pread, "pread is unportable - " Return the number of bytes written if successful, otherwise set errno and return -1. 0 indicates nothing written. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */ # if @REPLACE_PWRITE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef pwrite @@ -1239,7 +1340,7 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - " #if @GNULIB_READ@ /* Read up to COUNT bytes from file descriptor FD into the buffer starting at BUF. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */ # if @REPLACE_READ@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef read @@ -1263,7 +1364,7 @@ _GL_CXXALIASWARN (read); bytes of it into BUF. Return the number of bytes placed into BUF if successful, otherwise -1 and errno set. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */ # if @REPLACE_READLINK@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define readlink rpl_readlink @@ -1373,7 +1474,7 @@ _GL_WARN_ON_USE (sethostname, "sethostname is unportable - " /* Pause the execution of the current thread for N seconds. Returns the number of seconds left to sleep. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */ # if @REPLACE_SLEEP@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef sleep @@ -1453,6 +1554,36 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - " #endif +#if @GNULIB_TRUNCATE@ +/* Change the size of the file designated by FILENAME to become equal to LENGTH. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */ +# if @REPLACE_TRUNCATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef truncate +# define truncate rpl_truncate +# endif +_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length)); +# else +# if !@HAVE_DECL_TRUNCATE@ +_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); +# endif +_GL_CXXALIASWARN (truncate); +#elif defined GNULIB_POSIXCHECK +# undef truncate +# if HAVE_RAW_DECL_TRUNCATE +_GL_WARN_ON_USE (truncate, "truncate is unportable - " + "use gnulib module truncate for portability"); +# endif +#endif + + #if @GNULIB_TTYNAME_R@ /* Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number. */ @@ -1534,7 +1665,7 @@ _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " /* Pause the execution of the current thread for N microseconds. Returns 0 on completion, or -1 on range error. See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/usleep.html>. */ + <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>. */ # if @REPLACE_USLEEP@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef usleep @@ -1546,7 +1677,9 @@ _GL_CXXALIAS_RPL (usleep, int, (useconds_t n)); # if !@HAVE_USLEEP@ _GL_FUNCDECL_SYS (usleep, int, (useconds_t n)); # endif -_GL_CXXALIAS_SYS (usleep, int, (useconds_t n)); +/* Need to cast, because on Haiku, the first parameter is + unsigned int n. */ +_GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n)); # endif _GL_CXXALIASWARN (usleep); #elif defined GNULIB_POSIXCHECK @@ -1561,7 +1694,7 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - " #if @GNULIB_WRITE@ /* Write up to COUNT bytes starting at BUF to file descriptor FD. See the POSIX:2008 specification - <http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */ + <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */ # if @REPLACE_WRITE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef write |