From: Bruno Haible Date: Wed, 18 Nov 2020 01:33:33 +0000 (+0100) Subject: Fix error when GNULIB_POSIXCHECK is enabled (regression 2019-06-04). X-Git-Tag: v1.0~3502 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=8f591eb5eab9650b93aef4e57e0a4cc056ec571d;p=gnulib.git Fix error when GNULIB_POSIXCHECK is enabled (regression 2019-06-04). * lib/unistd.in.h (copy_file_range): Don't assume that copy_file_range is always declared. * m4/unistd_h.m4 (gl_UNISTD_H): Test whether copy_file_range is declared. --- diff --git a/ChangeLog b/ChangeLog index 5f14b87ea0..fcf2a3c1a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2020-11-17 Bruno Haible + + Fix error when GNULIB_POSIXCHECK is enabled (regression 2019-06-04). + * lib/unistd.in.h (copy_file_range): Don't assume that copy_file_range + is always declared. + * m4/unistd_h.m4 (gl_UNISTD_H): Test whether copy_file_range is + declared. + 2020-11-17 Bruno Haible Fix link errors on AIX. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index efe237fb2f..5cf6f9d247 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -397,10 +397,11 @@ _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, # endif _GL_CXXALIASWARN (copy_file_range); #elif defined GNULIB_POSIXCHECK -/* Assume copy_file_range is always declared. */ +# if HAVE_RAW_DECL_COPY_FILE_RANGE _GL_WARN_ON_USE (copy_file_range, "copy_file_range is unportable - " "use gnulib module copy_file_range for portability"); +# endif #endif diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index b4734daf60..07b9158195 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 81 +# unistd_h.m4 serial 82 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -41,7 +41,8 @@ AC_DEFUN([gl_UNISTD_H], # include # endif #endif - ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir + ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess + faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass getusershell setusershell endusershell