This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch zack/headers-cleanups updated. glibc-2.25-156-g0b7d6d5


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, zack/headers-cleanups has been updated
       via  0b7d6d5ee1cb6e0291f91bbda3eca86c3b9ec16f (commit)
      from  bf43546e08aa10d22bed648b58770e27cc8150a8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0b7d6d5ee1cb6e0291f91bbda3eca86c3b9ec16f

commit 0b7d6d5ee1cb6e0291f91bbda3eca86c3b9ec16f
Author: Zack Weinberg <zackw@panix.com>
Date:   Wed Mar 22 10:55:38 2017 -0400

    Remove __need_IOV_MAX and __need_FOPEN_MAX.
    
    __need_FOPEN_MAX wasn't being used anywhere.  __need_IOV_MAX was more
    complicated; the basic deal is that sys/uio.h wants to define a
    constant named UIO_MAXIOV and bits/xopen_lim.h wants to define a
    constant named IOV_MAX, with the same meaning.  For no apparent reason
    this was being handled via bits/stdio_lim.h -- stdio.h is NOT supposed
    to define IOV_MAX -- and some mess in Makerules.  Also, bits/uio.h on
    Linux was being used as a dumping ground for extension functions, and
    there's no longer any good reason for the definition of struct iovec
    itself to be system-dependent.
    
    So now we have bits/uio_lim.h, which defines __IOV_MAX.
    bits/xopen_lim.h and sys/uio.h use that to define their respective
    constants.  We also now have bits/types/struct_iovec.h, which is the
    one true definition of struct iovec, used by sys/uio.h and
    bits/fcntl-linux.h (another dumping ground for extension functions
    which I am not tackling in this patch series), and sys/uio_ext.h,
    which is the official Proper Home for extensions to sys/uio.h.  And
    stdio_lim.h doesn't define IOV_MAX at all.
    
    	* bits/uio_lim.h, sysdeps/unix/sysv/linux/bits/uio_lim.h
    	* misc/bits/types/struct_iovec.h, include/bits/types/struct_iovec.h
    	* sysdeps/generic/sys/uio_ext.h, sysdeps/unix/sysv/linux/sys/uio_ext.h:
    	New file.
    	* bits/uio.h, sysdeps/unix/sysv/linux/bits/uio.h: Delete file.
    
    	* include/bits/xopen_lim.h: Use bits/uio_lim.h to get the value
    	for IOV_MAX.
    	* misc/Makefile: Install sys/uio_ext.h, bits/uio_lim.h, and
    	bits/types/struct_iovec.h. Don't install bits/uio.h.
    	* misc/sys/uio.h: Use bits/types/struct_iovec.h to get the
    	definition of struct iovec, and bits/uio_lim.h to get the value
    	for UIO_MAXIOV.  Under __USE_GNU, include sys/uio_ext.h.
    	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h:
    	Use bits/types/struct_iovec.h to get the definition of struct
    	iovec.  Use __ssize_t, not ssize_t, in function prototypes.
    
    	* stdio-common/stdio_lim.h.in: Remove logic for __need_FOPEN_MAX
    	and __need_IOV_MAX.  Don't define IOV_MAX at all.
    	* Makerules (stdio_lim.h): Remove logic for setting IOV_MAX.

diff --git a/Makerules b/Makerules
index 6fb7248..767f515 100644
--- a/Makerules
+++ b/Makerules
@@ -1504,8 +1504,7 @@ $(stdio_lim:h=st): $(..)stdio-common/stdio_lim.h.in $(..)Rules \
 		   $(common-objpfx)config.make
 	$(make-target-directory)
 	{ echo '#include "$(..)posix/bits/posix1_lim.h"';		\
-	  echo '#define _LIBC 1';					\
-	  echo '#include "$(..)misc/sys/uio.h"'; } |			\
+	} |								\
 	$(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)' 	\
 	      $(CPPUNDEFS) $(+includes) -xc - -o $(@:st=hT)
 	sed $(sed-remove-objpfx) $(sed-remove-dotdot)			\
@@ -1513,21 +1512,14 @@ $(stdio_lim:h=st): $(..)stdio-common/stdio_lim.h.in $(..)Rules \
 	mv -f $(@:st=dt) $(@:st=d)
 	fopen_max=`sed -n 's/^#define OPEN_MAX //1p' $(@:st=hT)`; 	\
 	filename_max=`sed -n 's/^#define PATH_MAX //1p' $(@:st=hT)`;	\
-	iov_max=`sed -n 's/^#define UIO_MAXIOV //p' $(@:st=hT)`;	\
 	fopen_max=$${fopen_max:-16};					\
 	filename_max=$${filename_max:-1024};				\
-	if [ -z "$$iov_max" ]; then					\
-	  define_iov_max="# undef IOV_MAX";				\
-	else								\
-	  define_iov_max="# define IOV_MAX $$iov_max";			\
-	fi;								\
 	sed -e "s/@FOPEN_MAX@/$$fopen_max/"				\
 	    -e "s/@FILENAME_MAX@/$$filename_max/"			\
 	    -e "s/@L_tmpnam@/$(L_tmpnam)/"				\
 	    -e "s/@TMP_MAX@/$(TMP_MAX)/"				\
 	    -e "s/@L_ctermid@/$(L_ctermid)/"				\
 	    -e "s/@L_cuserid@/$(L_cuserid)/"				\
-	    -e "s/@define_IOV_MAX@/$$define_iov_max/"			\
 	    $< > $(@:st=h.new)
 	$(move-if-change) $(@:st=h.new) $(@:st=h)
 # Remove these last so that they can be examined if something went wrong.
diff --git a/bits/uio.h b/bits/uio_lim.h
similarity index 74%
copy from bits/uio.h
copy to bits/uio_lim.h
index def26df..f6919f0 100644
--- a/bits/uio.h
+++ b/bits/uio_lim.h
@@ -15,17 +15,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UIO_H
-# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
-#endif
-
+#ifndef _BITS_UIO_LIM_H
+#define _BITS_UIO_LIM_H 1
 
-/* `struct iovec' -- Structure describing a section of memory.  */
+/* Maximum length of the 'struct iovec' array in a single call to
+   readv or writev.  If there is no limit, the macro is not defined.  */
+#undef __IOV_MAX
 
-struct iovec
-{
-  /* Starting address.  */
-  __ptr_t iov_base;
-  /* Length in bytes.  */
-  size_t iov_len;
-};
+#endif
diff --git a/include/bits/types/struct_iovec.h b/include/bits/types/struct_iovec.h
new file mode 100644
index 0000000..f8f163f
--- /dev/null
+++ b/include/bits/types/struct_iovec.h
@@ -0,0 +1 @@
+#include <misc/bits/types/struct_iovec.h>
diff --git a/include/bits/xopen_lim.h b/include/bits/xopen_lim.h
index 2ae7cb3..4c5e62f 100644
--- a/include/bits/xopen_lim.h
+++ b/include/bits/xopen_lim.h
@@ -29,9 +29,6 @@
 #ifndef _XOPEN_LIM_H
 #define _XOPEN_LIM_H	1
 
-#define __need_IOV_MAX
-#include <bits/stdio_lim.h>
-
 /* We do not provide fixed values for
 
    ARG_MAX	Maximum length of argument to the `exec' function
@@ -60,10 +57,16 @@
 */
 
 
-/* Maximum number of `iovec' structures that one process has available
-   for use with `readv' or writev'.  */
+/* Maximum number of `iovec' structures that may be used in a single call
+   to `readv', `writev', etc.  */
 #define	_XOPEN_IOV_MAX	_POSIX_UIO_MAXIOV
 
+#include <bits/uio_lim.h>
+#ifdef __IOV_MAX
+# define IOV_MAX __IOV_MAX
+#else
+# undef IOV_MAX
+#endif
 
 /* Maximum value of `digit' in calls to the `printf' and `scanf'
    functions.  We have no limit, so return a reasonable value.  */
diff --git a/misc/Makefile b/misc/Makefile
index bd88253..ce26b84 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -23,7 +23,8 @@ subdir	:= misc
 
 include ../Makeconfig
 
-headers	:= sys/uio.h bits/uio.h sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \
+headers	:= sys/uio.h sys/uio_ext.h bits/uio_lim.h bits/types/struct_iovec.h \
+	   sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \
 	   sys/ptrace.h sys/file.h sys/dir.h sys/cdefs.h \
 	   ar.h a.out.h libgen.h stab.h bits/stab.def sgtty.h \
 	   ttyent.h paths.h sys/reboot.h \
diff --git a/misc/bits/types/struct_iovec.h b/misc/bits/types/struct_iovec.h
new file mode 100644
index 0000000..6ee0480
--- /dev/null
+++ b/misc/bits/types/struct_iovec.h
@@ -0,0 +1,14 @@
+#ifndef __struct_iovec_defined
+#define __struct_iovec_defined 1
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Structure for scatter/gather I/O.  */
+struct iovec
+  {
+    void *iov_base;     /* Pointer to data.  */
+    size_t iov_len;     /* Length of data.  */
+  };
+
+#endif
diff --git a/misc/sys/uio.h b/misc/sys/uio.h
index e80f013..9ad7615 100644
--- a/misc/sys/uio.h
+++ b/misc/sys/uio.h
@@ -19,15 +19,17 @@
 #define _SYS_UIO_H	1
 
 #include <features.h>
-
 #include <sys/types.h>
+#include <bits/types/struct_iovec.h>
+#include <bits/uio_lim.h>
+#ifdef __IOV_MAX
+# define UIO_MAXIOV __IOV_MAX
+#else
+# undef UIO_MAXIOV
+#endif
 
 __BEGIN_DECLS
 
-/* This file defines `struct iovec'.  */
-#include <bits/uio.h>
-
-
 /* Read data from file descriptor FD, and put the result in the
    buffers described by IOVEC, which is a vector of COUNT 'struct iovec's.
    The buffers are filled in the order specified.
@@ -119,4 +121,10 @@ extern ssize_t pwritev64 (int __fd, const struct iovec *__iovec, int __count,
 
 __END_DECLS
 
+/* Some operating systems provide system-specific extensions to this
+   header.  */
+#ifdef __USE_GNU
+# include <sys/uio_ext.h>
+#endif
+
 #endif /* sys/uio.h */
diff --git a/stdio-common/stdio_lim.h.in b/stdio-common/stdio_lim.h.in
index 510bf00..5288907 100644
--- a/stdio-common/stdio_lim.h.in
+++ b/stdio-common/stdio_lim.h.in
@@ -15,28 +15,25 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX
+#ifndef _BITS_STDIO_LIM_H
+#define _BITS_STDIO_LIM_H 1
+
+#ifndef _STDIO_H
 # error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
 #endif
 
-#ifdef _STDIO_H
-# define L_tmpnam @L_tmpnam@
-# define TMP_MAX @TMP_MAX@
-# define FILENAME_MAX @FILENAME_MAX@
+#define L_tmpnam @L_tmpnam@
+#define TMP_MAX @TMP_MAX@
+#define FILENAME_MAX @FILENAME_MAX@
 
-# ifdef __USE_POSIX
-#  define L_ctermid @L_ctermid@
-#  if !defined __USE_XOPEN2K || defined __USE_GNU
-#   define L_cuserid @L_cuserid@
-#  endif
+#ifdef __USE_POSIX
+# define L_ctermid @L_ctermid@
+# if !defined __USE_XOPEN2K || defined __USE_GNU
+#  define L_cuserid @L_cuserid@
 # endif
 #endif
 
-#if defined __need_FOPEN_MAX || defined _STDIO_H
-# undef  FOPEN_MAX
-# define FOPEN_MAX @FOPEN_MAX@
-#endif
+#undef  FOPEN_MAX
+#define FOPEN_MAX @FOPEN_MAX@
 
-#if defined __need_IOV_MAX && !defined IOV_MAX
-@define_IOV_MAX@
-#endif
+#endif /* bits/stdio_lim.h */
diff --git a/bits/uio.h b/sysdeps/generic/sys/uio_ext.h
similarity index 68%
copy from bits/uio.h
copy to sysdeps/generic/sys/uio_ext.h
index def26df..bd49003 100644
--- a/bits/uio.h
+++ b/sysdeps/generic/sys/uio_ext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -15,17 +15,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UIO_H
-# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
-#endif
+#ifndef _SYS_UIO_EXT_H
+#define _SYS_UIO_EXT_H 1
 
+#include <sys/uio.h>
 
-/* `struct iovec' -- Structure describing a section of memory.  */
+/* This operating system does not extend sys/uio.h.  */
 
-struct iovec
-{
-  /* Starting address.  */
-  __ptr_t iov_base;
-  /* Length in bytes.  */
-  size_t iov_len;
-};
+#endif /* sys/uio_ext.h */
diff --git a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
index 59d6631..71cbb50 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
+++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h
@@ -35,7 +35,7 @@
 */
 
 #ifdef __USE_GNU
-# include <bits/uio.h>
+# include <bits/types/struct_iovec.h>
 #endif
 
 /* open/fcntl.  */
@@ -339,7 +339,7 @@ __BEGIN_DECLS
 #ifdef __USE_GNU
 
 /* Provide kernel hint to read ahead.  */
-extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
+extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
     __THROW;
 
 
@@ -355,23 +355,23 @@ extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count,
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
-			 size_t __count, unsigned int __flags);
+extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+                           size_t __count, unsigned int __flags);
 
 /* Splice two files together.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
-		       __off64_t *__offout, size_t __len,
-		       unsigned int __flags);
+extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+                         __off64_t *__offout, size_t __len,
+                         unsigned int __flags);
 
 /* In-kernel implementation of tee for pipe buffers.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern ssize_t tee (int __fdin, int __fdout, size_t __len,
-		    unsigned int __flags);
+extern __ssize_t tee (int __fdin, int __fdout, size_t __len,
+                      unsigned int __flags);
 
 /* Reserve storage for the data of the file associated with FD.
 
diff --git a/sysdeps/unix/sysv/linux/bits/uio.h b/sysdeps/unix/sysv/linux/bits/uio.h
deleted file mode 100644
index 065a5d5..0000000
--- a/sysdeps/unix/sysv/linux/bits/uio.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#if !defined _SYS_UIO_H && !defined _FCNTL_H
-# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
-#endif
-
-#ifndef _BITS_UIO_H
-#define _BITS_UIO_H	1
-
-#include <sys/types.h>
-
-
-/* We should normally use the Linux kernel header file to define this
-   type and macros but this calls for trouble because of the header
-   includes other kernel headers.  */
-
-/* Size of object which can be written atomically.
-
-   This macro has different values in different kernel versions.  The
-   latest versions of the kernel use 1024 and this is good choice.  Since
-   the C library implementation of readv/writev is able to emulate the
-   functionality even if the currently running kernel does not support
-   this large value the readv/writev call will not fail because of this.  */
-#define UIO_MAXIOV	1024
-
-
-/* Structure for scatter/gather I/O.  */
-struct iovec
-  {
-    void *iov_base;	/* Pointer to data.  */
-    size_t iov_len;	/* Length of data.  */
-  };
-
-#endif
-
-
-#ifdef __USE_GNU
-# if defined _SYS_UIO_H && !defined _BITS_UIO_H_FOR_SYS_UIO_H
-#  define _BITS_UIO_H_FOR_SYS_UIO_H 1
-
-__BEGIN_DECLS
-
-/* Read from another process' address space.  */
-extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec,
-				 unsigned long int __liovcnt,
-				 const struct iovec *__rvec,
-				 unsigned long int __riovcnt,
-				 unsigned long int __flags)
-  __THROW;
-
-/* Write to another process' address space.  */
-extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
-				  unsigned long int __liovcnt,
-				  const struct iovec *__rvec,
-				  unsigned long int __riovcnt,
-				  unsigned long int __flags)
-  __THROW;
-
-__END_DECLS
-
-# endif
-#endif
diff --git a/bits/uio.h b/sysdeps/unix/sysv/linux/bits/uio_lim.h
similarity index 60%
copy from bits/uio.h
copy to sysdeps/unix/sysv/linux/bits/uio_lim.h
index def26df..7c69b93 100644
--- a/bits/uio.h
+++ b/sysdeps/unix/sysv/linux/bits/uio_lim.h
@@ -15,17 +15,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UIO_H
-# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
-#endif
+#ifndef _BITS_UIO_LIM_H
+#define _BITS_UIO_LIM_H 1
 
+/* Maximum length of the 'struct iovec' array in a single call to
+   readv or writev.
 
-/* `struct iovec' -- Structure describing a section of memory.  */
+   This macro has different values in different kernel versions.  The
+   latest versions of the kernel use 1024 and this is good choice.  Since
+   the C library implementation of readv/writev is able to emulate the
+   functionality even if the currently running kernel does not support
+   this large value the readv/writev call will not fail because of this.  */
+#define __IOV_MAX	1024
 
-struct iovec
-{
-  /* Starting address.  */
-  __ptr_t iov_base;
-  /* Length in bytes.  */
-  size_t iov_len;
-};
+#endif
diff --git a/bits/uio.h b/sysdeps/unix/sysv/linux/sys/uio_ext.h
similarity index 54%
rename from bits/uio.h
rename to sysdeps/unix/sysv/linux/sys/uio_ext.h
index def26df..3999e91 100644
--- a/bits/uio.h
+++ b/sysdeps/unix/sysv/linux/sys/uio_ext.h
@@ -15,17 +15,29 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UIO_H
-# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
-#endif
+#ifndef _SYS_UIO_EXT_H
+#define _SYS_UIO_EXT_H 1
 
+#include <sys/uio.h>
 
-/* `struct iovec' -- Structure describing a section of memory.  */
+__BEGIN_DECLS
 
-struct iovec
-{
-  /* Starting address.  */
-  __ptr_t iov_base;
-  /* Length in bytes.  */
-  size_t iov_len;
-};
+/* Read from another process' address space.  */
+extern ssize_t process_vm_readv (pid_t __pid, const struct iovec *__lvec,
+				 unsigned long int __liovcnt,
+				 const struct iovec *__rvec,
+				 unsigned long int __riovcnt,
+				 unsigned long int __flags)
+  __THROW;
+
+/* Write to another process' address space.  */
+extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
+				  unsigned long int __liovcnt,
+				  const struct iovec *__rvec,
+				  unsigned long int __riovcnt,
+				  unsigned long int __flags)
+  __THROW;
+
+__END_DECLS
+
+#endif /* sys/uio_ext.h */

-----------------------------------------------------------------------

Summary of changes:
 Makerules                                  |   10 +---
 bits/uio.h                                 |   31 -----------
 bits/uio_lim.h                             |   25 +++++++++
 include/bits/types/struct_iovec.h          |    1 +
 include/bits/xopen_lim.h                   |   13 +++--
 misc/Makefile                              |    3 +-
 misc/bits/types/struct_iovec.h             |   14 +++++
 misc/sys/uio.h                             |   18 +++++--
 stdio-common/stdio_lim.h.in                |   31 +++++------
 sysdeps/generic/sys/uio_ext.h              |   25 +++++++++
 sysdeps/unix/sysv/linux/bits/fcntl-linux.h |   18 +++---
 sysdeps/unix/sysv/linux/bits/uio.h         |   77 ----------------------------
 sysdeps/unix/sysv/linux/bits/uio_lim.h     |   31 +++++++++++
 sysdeps/unix/sysv/linux/sys/uio_ext.h      |   43 +++++++++++++++
 14 files changed, 186 insertions(+), 154 deletions(-)
 delete mode 100644 bits/uio.h
 create mode 100644 bits/uio_lim.h
 create mode 100644 include/bits/types/struct_iovec.h
 create mode 100644 misc/bits/types/struct_iovec.h
 create mode 100644 sysdeps/generic/sys/uio_ext.h
 delete mode 100644 sysdeps/unix/sysv/linux/bits/uio.h
 create mode 100644 sysdeps/unix/sysv/linux/bits/uio_lim.h
 create mode 100644 sysdeps/unix/sysv/linux/sys/uio_ext.h


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]