]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove __need_IOV_MAX and __need_FOPEN_MAX.
authorZack Weinberg <zackw@panix.com>
Wed, 22 Mar 2017 14:55:38 +0000 (10:55 -0400)
committerZack Weinberg <zackw@panix.com>
Wed, 14 Jun 2017 11:51:30 +0000 (07:51 -0400)
__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.

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/uio-ext.h, which is the official
Proper Home for extensions to sys/uio.h.  bits/uio.h is removed, and
stdio_lim.h doesn't define IOV_MAX at all.

* bits/uio_lim.h, sysdeps/unix/sysv/linux/bits/uio_lim.h
* bits/uio-ext.h, sysdeps/unix/sysv/linux/bits/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 bits/uio-ext.h and bits/uio_lim.h.
Don't install bits/uio.h.
* misc/sys/uio.h: Don't include bits/uio.h.  Do include
bits/types/struct_iovec.h and bits/uio_lim.h.  Set UIO_MAXIOV
based on __IOV_MAX. Under __USE_GNU, also include bits/uio-ext.h.

* 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.

* sysdeps/unix/sysv/linux/bits/fcntl-linux.h:
Include bits/types/struct_iovec.h, not bits/uio.h.
Use __ssize_t, not ssize_t, in function prototypes.
Don't use hard TAB for double space after period in comments.

ChangeLog
Makerules
bits/uio-ext.h [new file with mode: 0644]
bits/uio_lim.h [moved from bits/uio.h with 69% similarity]
include/bits/xopen_lim.h
misc/Makefile
misc/sys/uio.h
stdio-common/stdio_lim.h.in
sysdeps/unix/sysv/linux/bits/fcntl-linux.h
sysdeps/unix/sysv/linux/bits/uio-ext.h [moved from sysdeps/unix/sysv/linux/bits/uio.h with 59% similarity]
sysdeps/unix/sysv/linux/bits/uio_lim.h [new file with mode: 0644]

index a06a70c939002a77b22f2a743cda454796297c60..f7c9635aa36f4a9fb7a96c46548b5461fe6e860d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2017-06-14  Zack Weinberg  <zackw@panix.com>
+
+       * bits/uio_lim.h, sysdeps/unix/sysv/linux/bits/uio_lim.h
+       * bits/uio-ext.h, sysdeps/unix/sysv/linux/bits/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 bits/uio-ext.h and bits/uio_lim.h.
+       Don't install bits/uio.h.
+       * misc/sys/uio.h: Don't include bits/uio.h.  Do include
+       bits/types/struct_iovec.h and bits/uio_lim.h.  Set UIO_MAXIOV
+       based on __IOV_MAX. Under __USE_GNU, also include bits/uio-ext.h.
+
+       * 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.
+
+       * sysdeps/unix/sysv/linux/bits/fcntl-linux.h:
+       Include bits/types/struct_iovec.h, not bits/uio.h.
+       Use __ssize_t, not ssize_t, in function prototypes.
+       Don't use hard TAB for double space after period in comments.
+
 2017-06-14  Alan Modra  <amodra@gmail.com>
 
        * elf/elf.h (PPC64_OPT_LOCALENTRY): Define.
index f91a4c5d66f0b7837353fb3784a9e99c49474b11..9bb707c168acd9f5d4dbf29a4d8aad79a817a9c4 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -1521,8 +1521,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)                   \
@@ -1530,21 +1529,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-ext.h b/bits/uio-ext.h
new file mode 100644 (file)
index 0000000..cd4039c
--- /dev/null
@@ -0,0 +1,28 @@
+/* Operating system-specific extensions to sys/uio.h - generic version.
+   Copyright (C) 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/>.  */
+
+#ifndef _BITS_UIO_EXT_H
+#define _BITS_UIO_EXT_H 1
+
+#ifndef _SYS_UIO_H
+# error "Never include <bits/uio-ext.h> directly; use <sys/uio.h> instead."
+#endif
+
+/* This operating system does not extend sys/uio.h.  */
+
+#endif /* sys/uio_ext.h */
similarity index 69%
rename from bits/uio.h
rename to bits/uio_lim.h
index 96a3a71d427f5850a0da44c92d71481ef5ab241d..63afbdcb3b2b290a4894460997c1cce20ff81fd3 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
+/* Implementation limits related to sys/uio.h - generic version.
+   Copyright (C) 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
    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.  If there is no limit, the macro is not defined.  */
+#undef __IOV_MAX
 
-#include <bits/types/struct_iovec.h>
+#endif
index 2ae7cb365272a0d13db8dc78e39767301a1cda3d..4c5e62f71b44ceb55f63a5d7a888691b651ad29e 100644 (file)
@@ -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
 */
 
 
-/* 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.  */
index 46072e62d957b9ece24f67f00fc13bd295f44013..8660b6fc74b1317a394bf7165ec510cf5cad691f 100644 (file)
@@ -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 bits/uio-ext.h bits/uio_lim.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 \
index 66c22f04f645fc17ef7bda7fefe08b1b8747ecce..2ae918a8d4aee57f99e4a15b924b5c51fdc34551 100644 (file)
 #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.
@@ -160,4 +162,10 @@ extern ssize_t pwritev64v2 (int __fd, const struct iovec *__iodev,
 
 __END_DECLS
 
+/* Some operating systems provide system-specific extensions to this
+   header.  */
+#ifdef __USE_GNU
+# include <bits/uio-ext.h>
+#endif
+
 #endif /* sys/uio.h */
index 510bf008aae28facad108da507b4ac4de48a5d18..52889074699cd0d7e49478d60e07b2763e08adef 100644 (file)
    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 */
index 59d663196a085cb10e8e7dde4b0e38bc04830426..0cd0a5d731a9558431ec9dbc36fd89c7f984440c 100644 (file)
@@ -35,7 +35,7 @@
 */
 
 #ifdef __USE_GNU
-# include <bits/uio.h>
+# include <bits/types/struct_iovec.h>
 #endif
 
 /* open/fcntl.  */
@@ -76,7 +76,7 @@
 #endif
 
 #ifndef __O_DIRECTORY
-# define __O_DIRECTORY  0200000
+# define __O_DIRECTORY 0200000
 #endif
 #ifndef __O_NOFOLLOW
 # define __O_NOFOLLOW  0400000
 # ifndef __USE_FILE_OFFSET64
 #  define F_GETLK      5       /* Get record locking info.  */
 #  define F_SETLK      6       /* Set record locking info (non-blocking).  */
-#  define F_SETLKW     7       /* Set record locking info (blocking).  */
+#  define F_SETLKW     7       /* Set record locking info (blocking).  */
 # else
-#  define F_GETLK      F_GETLK64  /* Get record locking info.  */
+#  define F_GETLK      F_GETLK64  /* Get record locking info.  */
 #  define F_SETLK      F_SETLK64  /* Set record locking info (non-blocking).*/
 #  define F_SETLKW     F_SETLKW64 /* Set record locking info (blocking).  */
 # endif
 #ifndef F_GETLK64
 # define F_GETLK64     12      /* Get record locking info.  */
 # define F_SETLK64     13      /* Set record locking info (non-blocking).  */
-# define F_SETLKW64    14      /* Set record locking info (blocking).  */
+# define F_SETLKW64    14      /* Set record locking info (blocking).  */
 #endif
 
 /* open file description locks.
 #endif
 
 #ifdef __USE_XOPEN2K8
-# define O_DIRECTORY   __O_DIRECTORY   /* Must be a directory.  */
-# define O_NOFOLLOW    __O_NOFOLLOW    /* Do not follow links.  */
+# define O_DIRECTORY   __O_DIRECTORY   /* Must be a directory.  */
+# define O_NOFOLLOW    __O_NOFOLLOW    /* Do not follow links.  */
 # define O_CLOEXEC     __O_CLOEXEC     /* Set close_on_exec.  */
 #endif
 
 #ifdef __USE_GNU
-# define O_DIRECT      __O_DIRECT      /* Direct disk access.  */
+# define O_DIRECT      __O_DIRECT      /* Direct disk access.  */
 # define O_NOATIME     __O_NOATIME     /* Do not set atime.  */
 # define O_PATH                __O_PATH        /* Resolve pathname but do not open file.  */
 # define O_TMPFILE     __O_TMPFILE     /* Atomically create nameless file.  */
 #endif
 
-/* For now, Linux has no separate synchronicitiy options for read
+/* For now, Linux has no separate synchronicity options for read
    operations.  We define O_RSYNC therefore as the same as O_SYNC
    since this is a superset.  */
 #if defined __USE_POSIX199309 || defined __USE_UNIX98
 # define O_DSYNC       __O_DSYNC       /* Synchronize data.  */
 # if defined __O_RSYNC
-#  define O_RSYNC      __O_RSYNC       /* Synchronize read operations.  */
+#  define O_RSYNC      __O_RSYNC       /* Synchronize read operations.  */
 # else
-#  define O_RSYNC      O_SYNC          /* Synchronize read operations.  */
+#  define O_RSYNC      O_SYNC          /* Synchronize read operations.  */
 # endif
 #endif
 
 #endif
 
 #ifdef __USE_GNU
-# define F_SETLEASE    1024    /* Set a lease.  */
+# define F_SETLEASE    1024    /* Set a lease.  */
 # define F_GETLEASE    1025    /* Enquire what lease is active.  */
 # define F_NOTIFY      1026    /* Request notifications on a directory.  */
 # define F_SETPIPE_SZ  1031    /* Set pipe page size array.  */
 #ifndef F_RDLCK
 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
 # define F_RDLCK               0       /* Read lock.  */
-# define F_WRLCK               1       /* Write lock.  */
-# define F_UNLCK               2       /* Remove lock.  */
+# define F_WRLCK               1       /* Write lock.  */
+# define F_UNLCK               2       /* Remove lock.  */
 #endif
 
 
 #endif
 
 #ifdef __USE_GNU
-# define LOCK_MAND     32      /* This is a mandatory flock:   */
-# define LOCK_READ     64      /* ... which allows concurrent read operations.  */
+# define LOCK_MAND     32      /* This is a mandatory flock:  */
+# define LOCK_READ     64      /* ... which allows concurrent read operations.  */
 # define LOCK_WRITE    128     /* ... which allows concurrent write operations.  */
-# define LOCK_RW       192     /* ... Which allows concurrent read & write operations.  */
+# define LOCK_RW       192     /* ... Which allows concurrent read & write operations.  */
 #endif
 
 #ifdef __USE_GNU
@@ -289,7 +289,7 @@ struct f_owner_ex
 #ifdef __USE_XOPEN2K
 # define POSIX_FADV_NORMAL     0 /* No further special treatment.  */
 # define POSIX_FADV_RANDOM     1 /* Expect random page references.  */
-# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references.  */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references.  */
 # define POSIX_FADV_WILLNEED   3 /* Will need these pages.  */
 # define POSIX_FADV_DONTNEED   __POSIX_FADV_DONTNEED /* Don't need these pages.  */
 # define POSIX_FADV_NOREUSE    __POSIX_FADV_NOREUSE /* Data will be accessed once.  */
@@ -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.
 
similarity index 59%
rename from sysdeps/unix/sysv/linux/bits/uio.h
rename to sysdeps/unix/sysv/linux/bits/uio-ext.h
index d5701f8171ba27b879b4f4eabdd539e056945cec..4ddb6448b0a5606d153d8471f468cec094e42365 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
+/* Operating system-specific extensions to sys/uio.h - Linux version.
+   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
    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
-
-
-#include <bits/types/struct_iovec.h>
+#ifndef _BITS_UIO_EXT_H
+#define _BITS_UIO_EXT_H 1
 
+#ifndef _SYS_UIO_H
+# error "Never include <bits/uio-ext.h> directly; use <sys/uio.h> instead."
 #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.  */
@@ -66,13 +41,12 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
                                  unsigned long int __flags)
   __THROW;
 
-__END_DECLS
-
-# endif
 
 /* Flags for preadv2/pwritev2: */
 #define RWF_HIPRI      0x00000001 /* High priority request.  */
 #define RWF_DSYNC      0x00000002 /* per-IO O_DSYNC.  */
 #define RWF_SYNC       0x00000004 /* per-IO O_SYNC.  */
 
-#endif
+__END_DECLS
+
+#endif /* bits/uio-ext.h */
diff --git a/sysdeps/unix/sysv/linux/bits/uio_lim.h b/sysdeps/unix/sysv/linux/bits/uio_lim.h
new file mode 100644 (file)
index 0000000..26c0b67
--- /dev/null
@@ -0,0 +1,32 @@
+/* Implementation limits related to sys/uio.h - Linux version.
+   Copyright (C) 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/>.  */
+
+#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.
+
+   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
+
+#endif