summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-10-09 20:15:32 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-10-09 20:15:32 +0200
commitcbe8b6f603fbea1d64e3570f299a2bf25adfa6fc (patch)
treea62a92aded65b2e0834a4d72701415ed3cca4299 /misc
parentd6a8ab3c9097ce211e9aa7780ddd31b4f62d380f (diff)
parent0b113e90a20146a2783f7cb2f3e7de716b892d5f (diff)
Merge branch 't/tls' into refs/top-bases/tschwinge/Roger_Whittaker
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile5
-rw-r--r--misc/Versions3
-rw-r--r--misc/acct.c5
-rw-r--r--misc/ar.h2
-rw-r--r--misc/bits/error.h2
-rw-r--r--misc/bits/select2.h2
-rw-r--r--misc/bits/stab.def2
-rw-r--r--misc/bits/syslog-ldbl.h2
-rw-r--r--misc/bits/syslog.h2
-rw-r--r--misc/brk.c5
-rw-r--r--misc/bug18240.c97
-rw-r--r--misc/chflags.c6
-rw-r--r--misc/chroot.c5
-rw-r--r--misc/daemon.c3
-rw-r--r--misc/dirname.c2
-rw-r--r--misc/efgcvt.c19
-rw-r--r--misc/efgcvt_r.c16
-rw-r--r--misc/err.c2
-rw-r--r--misc/err.h2
-rw-r--r--misc/error.c15
-rw-r--r--misc/error.h2
-rw-r--r--misc/fchflags.c6
-rw-r--r--misc/fdatasync.c2
-rw-r--r--misc/fgetxattr.c2
-rw-r--r--misc/flistxattr.c2
-rw-r--r--misc/fremovexattr.c2
-rw-r--r--misc/fsetxattr.c2
-rw-r--r--misc/fstab.c10
-rw-r--r--misc/fsync.c5
-rw-r--r--misc/ftruncate.c6
-rw-r--r--misc/ftruncate64.c6
-rw-r--r--misc/futimes.c2
-rw-r--r--misc/futimesat.c7
-rw-r--r--misc/getauxval.c2
-rw-r--r--misc/getclktck.c2
-rw-r--r--misc/getdomain.c10
-rw-r--r--misc/getdtsz.c2
-rw-r--r--misc/gethostid.c2
-rw-r--r--misc/gethostname.c6
-rw-r--r--misc/getloadavg.c2
-rw-r--r--misc/getpagesize.c2
-rw-r--r--misc/getpass.c7
-rw-r--r--misc/getsysstats.c2
-rw-r--r--misc/getttyent.c6
-rw-r--r--misc/getxattr.c2
-rw-r--r--misc/gtty.c6
-rw-r--r--misc/hsearch.c9
-rw-r--r--misc/hsearch_r.c46
-rw-r--r--misc/ifunc-impl-list.c2
-rw-r--r--misc/init-misc.c2
-rw-r--r--misc/insremque.c2
-rw-r--r--misc/ioctl.c6
-rw-r--r--misc/lgetxattr.c2
-rw-r--r--misc/libgen.h2
-rw-r--r--misc/listxattr.c2
-rw-r--r--misc/llistxattr.c2
-rw-r--r--misc/lremovexattr.c2
-rw-r--r--misc/lsearch.c2
-rw-r--r--misc/lsetxattr.c2
-rw-r--r--misc/lutimes.c2
-rw-r--r--misc/madvise.c2
-rw-r--r--misc/mincore.c2
-rw-r--r--misc/mkdtemp.c5
-rw-r--r--misc/mkostemp.c6
-rw-r--r--misc/mkostemp64.c6
-rw-r--r--misc/mkostemps.c7
-rw-r--r--misc/mkostemps64.c7
-rw-r--r--misc/mkstemp.c5
-rw-r--r--misc/mkstemp64.c5
-rw-r--r--misc/mkstemps.c6
-rw-r--r--misc/mkstemps64.c6
-rw-r--r--misc/mktemp.c8
-rw-r--r--misc/mlock.c2
-rw-r--r--misc/mlockall.c2
-rw-r--r--misc/mmap.c2
-rw-r--r--misc/mmap64.c2
-rw-r--r--misc/mntent.c4
-rw-r--r--misc/mntent.h2
-rw-r--r--misc/mntent_r.c6
-rw-r--r--misc/mprotect.c2
-rw-r--r--misc/msync.c2
-rw-r--r--misc/munlock.c2
-rw-r--r--misc/munlockall.c2
-rw-r--r--misc/munmap.c2
-rw-r--r--misc/preadv.c8
-rw-r--r--misc/preadv64.c8
-rw-r--r--misc/pselect.c2
-rw-r--r--misc/ptrace.c2
-rw-r--r--misc/pwritev.c8
-rw-r--r--misc/pwritev64.c8
-rw-r--r--misc/qefgcvt.c2
-rw-r--r--misc/qefgcvt_r.c2
-rw-r--r--misc/readv.c7
-rw-r--r--misc/reboot.c2
-rw-r--r--misc/regexp.c31
-rw-r--r--misc/regexp.h214
-rw-r--r--misc/remap_file_pages.c2
-rw-r--r--misc/removexattr.c2
-rw-r--r--misc/revoke.c5
-rw-r--r--misc/sbrk.c2
-rw-r--r--misc/search.h2
-rw-r--r--misc/select.c10
-rw-r--r--misc/setdomain.c6
-rw-r--r--misc/setegid.c5
-rw-r--r--misc/seteuid.c5
-rw-r--r--misc/sethostid.c5
-rw-r--r--misc/sethostname.c6
-rw-r--r--misc/setregid.c6
-rw-r--r--misc/setreuid.c6
-rw-r--r--misc/setxattr.c2
-rw-r--r--misc/sgtty.h2
-rw-r--r--misc/sstk.c5
-rw-r--r--misc/stty.c6
-rw-r--r--misc/swapoff.c2
-rw-r--r--misc/swapon.c2
-rw-r--r--misc/sync.c2
-rw-r--r--misc/syncfs.c2
-rw-r--r--misc/sys/auxv.h2
-rw-r--r--misc/sys/cdefs.h2
-rw-r--r--misc/sys/dir.h2
-rw-r--r--misc/sys/file.h2
-rw-r--r--misc/sys/ioctl.h2
-rw-r--r--misc/sys/mman.h2
-rw-r--r--misc/sys/param.h5
-rw-r--r--misc/sys/select.h2
-rw-r--r--misc/sys/uio.h2
-rw-r--r--misc/sys/ustat.h2
-rw-r--r--misc/sys/xattr.h2
-rw-r--r--misc/syscall.c5
-rw-r--r--misc/syslog.c38
-rw-r--r--misc/truncate.c6
-rw-r--r--misc/truncate64.c6
-rw-r--r--misc/tsearch.c7
-rw-r--r--misc/tst-dirname.c2
-rw-r--r--misc/tst-efgcvt.c2
-rw-r--r--misc/tst-fdset.c2
-rw-r--r--misc/tst-mntent-blank-corrupt.c45
-rw-r--r--misc/tst-mntent-blank-passno.c53
-rw-r--r--misc/tst-mntent.c27
-rw-r--r--misc/tst-tsearch.c10
-rw-r--r--misc/ualarm.c6
-rw-r--r--misc/usleep.c5
-rw-r--r--misc/ustat.c6
-rw-r--r--misc/utimes.c6
-rw-r--r--misc/vhangup.c2
-rw-r--r--misc/writev.c7
146 files changed, 492 insertions, 627 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 6080c6b727..4bfc935fd8 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2015 Free Software Foundation, Inc.
+# Copyright (C) 1991-2016 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
@@ -76,7 +76,8 @@ install-lib := libg.a
gpl2lgpl := error.c error.h
tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
- tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1
+ tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1 \
+ tst-mntent-blank-corrupt tst-mntent-blank-passno bug18240
ifeq ($(run-built-tests),yes)
tests-special += $(objpfx)tst-error1-mem.out
endif
diff --git a/misc/Versions b/misc/Versions
index 534d1a3fca..671f4870e9 100644
--- a/misc/Versions
+++ b/misc/Versions
@@ -149,6 +149,9 @@ libc {
GLIBC_2.16 {
__getauxval; getauxval;
}
+ GLIBC_2.23 {
+ # SHLIB_COMPAT(GLIBC_2_0, GLIBC_2_23) used in regexp.c
+ }
GLIBC_PRIVATE {
__madvise;
__mktemp;
diff --git a/misc/acct.c b/misc/acct.c
index c5569e5afa..74ff43a233 100644
--- a/misc/acct.c
+++ b/misc/acct.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -22,8 +22,7 @@
a record for each process as it terminates, to this file. If NAME is NULL,
turn accounting off. This call is restricted to the super-user. */
int
-acct (name)
- const char *name;
+acct (const char *name)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/ar.h b/misc/ar.h
index 8b82f648d8..caa0223811 100644
--- a/misc/ar.h
+++ b/misc/ar.h
@@ -1,5 +1,5 @@
/* Header describing `ar' archive file format.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 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
diff --git a/misc/bits/error.h b/misc/bits/error.h
index d903bcdbb4..84082897f8 100644
--- a/misc/bits/error.h
+++ b/misc/bits/error.h
@@ -1,5 +1,5 @@
/* Specializations for error functions.
- Copyright (C) 2007-2015 Free Software Foundation, Inc.
+ Copyright (C) 2007-2016 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
diff --git a/misc/bits/select2.h b/misc/bits/select2.h
index 9b37e3bdb3..56f2205ad5 100644
--- a/misc/bits/select2.h
+++ b/misc/bits/select2.h
@@ -1,5 +1,5 @@
/* Checking macros for select functions.
- Copyright (C) 2011-2015 Free Software Foundation, Inc.
+ Copyright (C) 2011-2016 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
diff --git a/misc/bits/stab.def b/misc/bits/stab.def
index 68df2db56e..2af2ddfc63 100644
--- a/misc/bits/stab.def
+++ b/misc/bits/stab.def
@@ -1,5 +1,5 @@
/* Table of DBX symbol codes for the GNU system.
- Copyright (C) 1988, 1997-2015 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1997-2016 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
diff --git a/misc/bits/syslog-ldbl.h b/misc/bits/syslog-ldbl.h
index 7e5362d44a..7c1c03de95 100644
--- a/misc/bits/syslog-ldbl.h
+++ b/misc/bits/syslog-ldbl.h
@@ -1,5 +1,5 @@
/* -mlong-double-64 compatibility mode for syslog functions.
- Copyright (C) 2006-2015 Free Software Foundation, Inc.
+ Copyright (C) 2006-2016 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
diff --git a/misc/bits/syslog.h b/misc/bits/syslog.h
index 7a84be4eac..31dae38e57 100644
--- a/misc/bits/syslog.h
+++ b/misc/bits/syslog.h
@@ -1,5 +1,5 @@
/* Checking macros for syslog functions.
- Copyright (C) 2005-2015 Free Software Foundation, Inc.
+ Copyright (C) 2005-2016 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
diff --git a/misc/brk.c b/misc/brk.c
index 28c4203399..76bd1b740d 100644
--- a/misc/brk.c
+++ b/misc/brk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -24,8 +24,7 @@ void *__curbrk;
/* Set the end of the process's data space to ADDR.
Return 0 if successful, -1 if not. */
int
-__brk (addr)
- void *addr;
+__brk (void *addr)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/bug18240.c b/misc/bug18240.c
new file mode 100644
index 0000000000..773586ee10
--- /dev/null
+++ b/misc/bug18240.c
@@ -0,0 +1,97 @@
+/* Test integer wraparound in hcreate.
+ Copyright (C) 2016 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/>. */
+
+#include <errno.h>
+#include <limits.h>
+#include <search.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/resource.h>
+
+static void
+test_size (size_t size)
+{
+ int res = hcreate (size);
+ if (res == 0)
+ {
+ if (errno == ENOMEM)
+ return;
+ printf ("error: hcreate (%zu): %m\n", size);
+ exit (1);
+ }
+ char *keys[100];
+ for (int i = 0; i < 100; ++i)
+ {
+ if (asprintf (keys + i, "%d", i) < 0)
+ {
+ printf ("error: asprintf: %m\n");
+ exit (1);
+ }
+ ENTRY e = { keys[i], (char *) "value" };
+ if (hsearch (e, ENTER) == NULL)
+ {
+ printf ("error: hsearch (\"%s\"): %m\n", keys[i]);
+ exit (1);
+ }
+ }
+ hdestroy ();
+
+ for (int i = 0; i < 100; ++i)
+ free (keys[i]);
+}
+
+static int
+do_test (void)
+{
+ /* Limit the size of the process, so that memory allocation will
+ fail without impacting the entire system. */
+ {
+ struct rlimit limit;
+ if (getrlimit (RLIMIT_AS, &limit) != 0)
+ {
+ printf ("getrlimit (RLIMIT_AS) failed: %m\n");
+ return 1;
+ }
+ long target = 100 * 1024 * 1024;
+ if (limit.rlim_cur == RLIM_INFINITY || limit.rlim_cur > target)
+ {
+ limit.rlim_cur = target;
+ if (setrlimit (RLIMIT_AS, &limit) != 0)
+ {
+ printf ("setrlimit (RLIMIT_AS) failed: %m\n");
+ return 1;
+ }
+ }
+ }
+
+ test_size (500);
+ test_size (-1);
+ test_size (-3);
+ test_size (INT_MAX - 2);
+ test_size (INT_MAX - 1);
+ test_size (INT_MAX);
+ test_size (((unsigned) INT_MAX) + 1);
+ test_size (UINT_MAX - 2);
+ test_size (UINT_MAX - 1);
+ test_size (UINT_MAX);
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/misc/chflags.c b/misc/chflags.c
index 241be86be7..49c2fec851 100644
--- a/misc/chflags.c
+++ b/misc/chflags.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -24,9 +24,7 @@
int chflags (const char *file, unsigned long int flags) __THROW;
int
-chflags (file, flags)
- const char *file;
- unsigned long int flags;
+chflags (const char *file, unsigned long int flags)
{
if (file == NULL)
{
diff --git a/misc/chroot.c b/misc/chroot.c
index 232a29f363..b863f3108f 100644
--- a/misc/chroot.c
+++ b/misc/chroot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -21,8 +21,7 @@
/* Make PATH be the root directory (the starting point for absolute paths).
This call is restricted to the super-user. */
int
-chroot (path)
- const char *path;
+chroot (const char *path)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/daemon.c b/misc/daemon.c
index 7597ce9996..9d186b24bd 100644
--- a/misc/daemon.c
+++ b/misc/daemon.c
@@ -41,8 +41,7 @@ static char sccsid[] = "@(#)daemon.c 8.1 (Berkeley) 6/4/93";
#include <not-cancel.h>
int
-daemon(nochdir, noclose)
- int nochdir, noclose;
+daemon (int nochdir, int noclose)
{
int fd;
diff --git a/misc/dirname.c b/misc/dirname.c
index 0ddae88865..a3dd52f2e8 100644
--- a/misc/dirname.c
+++ b/misc/dirname.c
@@ -1,5 +1,5 @@
/* dirname - return directory part of PATH.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/misc/efgcvt.c b/misc/efgcvt.c
index 7c7939192b..c5b5f23558 100644
--- a/misc/efgcvt.c
+++ b/misc/efgcvt.c
@@ -1,5 +1,5 @@
/* Compatibility functions for floating point formatting.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <sys/param.h>
#include <float.h>
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
#include <math_ldbl_opt.h>
#ifndef FLOAT_TYPE
@@ -64,9 +64,8 @@ static char ECVT_BUFFER[MAXDIG];
libc_freeres_ptr (static char *FCVT_BUFPTR);
char *
-__APPEND (FUNC_PREFIX, fcvt) (value, ndigit, decpt, sign)
- FLOAT_TYPE value;
- int ndigit, *decpt, *sign;
+__APPEND (FUNC_PREFIX, fcvt) (FLOAT_TYPE value, int ndigit, int *decpt,
+ int *sign)
{
if (FCVT_BUFPTR == NULL)
{
@@ -87,9 +86,8 @@ __APPEND (FUNC_PREFIX, fcvt) (value, ndigit, decpt, sign)
char *
-__APPEND (FUNC_PREFIX, ecvt) (value, ndigit, decpt, sign)
- FLOAT_TYPE value;
- int ndigit, *decpt, *sign;
+__APPEND (FUNC_PREFIX, ecvt) (FLOAT_TYPE value, int ndigit, int *decpt,
+ int *sign)
{
(void) __APPEND (FUNC_PREFIX, ecvt_r) (value, ndigit, decpt, sign,
ECVT_BUFFER, MAXDIG);
@@ -98,10 +96,7 @@ __APPEND (FUNC_PREFIX, ecvt) (value, ndigit, decpt, sign)
}
char *
-__APPEND (FUNC_PREFIX, gcvt) (value, ndigit, buf)
- FLOAT_TYPE value;
- int ndigit;
- char *buf;
+__APPEND (FUNC_PREFIX, gcvt) (FLOAT_TYPE value, int ndigit, char *buf)
{
sprintf (buf, "%.*" FLOAT_FMT_FLAG "g", MIN (ndigit, NDIGIT_MAX), value);
return buf;
diff --git a/misc/efgcvt_r.c b/misc/efgcvt_r.c
index 2761222d87..a172760ecc 100644
--- a/misc/efgcvt_r.c
+++ b/misc/efgcvt_r.c
@@ -1,5 +1,5 @@
/* Compatibility functions for floating point formatting, reentrant versions.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
@@ -71,11 +71,8 @@
int
-__APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, buf, len)
- FLOAT_TYPE value;
- int ndigit, *decpt, *sign;
- char *buf;
- size_t len;
+__APPEND (FUNC_PREFIX, fcvt_r) (FLOAT_TYPE value, int ndigit, int *decpt,
+ int *sign, char *buf, size_t len)
{
ssize_t n;
ssize_t i;
@@ -169,11 +166,8 @@ __APPEND (FUNC_PREFIX, fcvt_r) (value, ndigit, decpt, sign, buf, len)
}
int
-__APPEND (FUNC_PREFIX, ecvt_r) (value, ndigit, decpt, sign, buf, len)
- FLOAT_TYPE value;
- int ndigit, *decpt, *sign;
- char *buf;
- size_t len;
+__APPEND (FUNC_PREFIX, ecvt_r) (FLOAT_TYPE value, int ndigit, int *decpt,
+ int *sign, char *buf, size_t len)
{
int exponent = 0;
diff --git a/misc/err.c b/misc/err.c
index 7b98157d59..3067835a5d 100644
--- a/misc/err.c
+++ b/misc/err.c
@@ -1,5 +1,5 @@
/* 4.4BSD utility functions for error messages.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
diff --git a/misc/err.h b/misc/err.h
index 99e1cdd88e..b43fe68fea 100644
--- a/misc/err.h
+++ b/misc/err.h
@@ -1,5 +1,5 @@
/* 4.4BSD utility functions for error messages.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
diff --git a/misc/error.c b/misc/error.c
index aaa120d5ab..c4c0ae95fd 100644
--- a/misc/error.c
+++ b/misc/error.c
@@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
- Copyright (C) 1990-2015 Free Software Foundation, Inc.
+ Copyright (C) 1990-2016 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
@@ -85,7 +85,7 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
# undef putc
# define putc(c, fp) _IO_putc (c, fp)
-# include <bits/libc-lock.h>
+# include <libc-lock.h>
#else /* not _LIBC */
@@ -298,8 +298,8 @@ error (int status, int errnum, const char *message, ...)
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
- 0);
+ __libc_ptf_call (__pthread_setcancelstate,
+ (PTHREAD_CANCEL_DISABLE, &state), 0);
#endif
flush_stdout ();
@@ -323,7 +323,7 @@ error (int status, int errnum, const char *message, ...)
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+ __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
@@ -360,7 +360,8 @@ error_at_line (int status, int errnum, const char *file_name,
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
+ __libc_ptf_call (__pthread_setcancelstate,
+ (PTHREAD_CANCEL_DISABLE, &state),
0);
#endif
@@ -393,7 +394,7 @@ error_at_line (int status, int errnum, const char *file_name,
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+ __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
diff --git a/misc/error.h b/misc/error.h
index 7356677c09..32d84ee92d 100644
--- a/misc/error.h
+++ b/misc/error.h
@@ -1,5 +1,5 @@
/* Declaration for error-reporting function
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
diff --git a/misc/fchflags.c b/misc/fchflags.c
index b9f267583b..b3115f7660 100644
--- a/misc/fchflags.c
+++ b/misc/fchflags.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -24,9 +24,7 @@
int fchflags (int fd, unsigned long int flags) __THROW;
int
-fchflags (fd, flags)
- int fd;
- unsigned long int flags;
+fchflags (int fd, unsigned long int flags)
{
if (fd < 0)
{
diff --git a/misc/fdatasync.c b/misc/fdatasync.c
index 60ebee1db3..8bc1ec38e3 100644
--- a/misc/fdatasync.c
+++ b/misc/fdatasync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2016 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
diff --git a/misc/fgetxattr.c b/misc/fgetxattr.c
index 360a990156..6ab1cc08b6 100644
--- a/misc/fgetxattr.c
+++ b/misc/fgetxattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/flistxattr.c b/misc/flistxattr.c
index 69562be0ed..22db5b44fd 100644
--- a/misc/flistxattr.c
+++ b/misc/flistxattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/fremovexattr.c b/misc/fremovexattr.c
index 7692319c0f..a51ef00988 100644
--- a/misc/fremovexattr.c
+++ b/misc/fremovexattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/fsetxattr.c b/misc/fsetxattr.c
index 500fe47d12..8a2a7a1a48 100644
--- a/misc/fsetxattr.c
+++ b/misc/fsetxattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/fstab.c b/misc/fstab.c
index 2d2e93216e..41b4874431 100644
--- a/misc/fstab.c
+++ b/misc/fstab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2016 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
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
#define BUFFER_SIZE 0x1fc0
@@ -61,8 +61,7 @@ getfsent (void)
struct fstab *
-getfsspec (name)
- const char *name;
+getfsspec (const char *name)
{
struct fstab_state *state;
struct mntent *m;
@@ -78,8 +77,7 @@ getfsspec (name)
struct fstab *
-getfsfile (name)
- const char *name;
+getfsfile (const char *name)
{
struct fstab_state *state;
struct mntent *m;
diff --git a/misc/fsync.c b/misc/fsync.c
index 05f3acfc0a..a6f1901c1c 100644
--- a/misc/fsync.c
+++ b/misc/fsync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -20,8 +20,7 @@
/* Make all changes done to FD actually appear on disk. */
int
-fsync (fd)
- int fd;
+fsync (int fd)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/ftruncate.c b/misc/ftruncate.c
index 2d43c76a37..c64cad1dcb 100644
--- a/misc/ftruncate.c
+++ b/misc/ftruncate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -21,9 +21,7 @@
/* Truncate the file referenced by FD to LENGTH bytes. */
int
-__ftruncate (fd, length)
- int fd;
- off_t length;
+__ftruncate (int fd, off_t length)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/ftruncate64.c b/misc/ftruncate64.c
index 1c41fea5a5..8c5231410e 100644
--- a/misc/ftruncate64.c
+++ b/misc/ftruncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2016 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
@@ -21,9 +21,7 @@
/* Truncate the file referenced by FD to LENGTH bytes. */
int
-__ftruncate64 (fd, length)
- int fd;
- off64_t length;
+__ftruncate64 (int fd, off64_t length)
{
if ((off_t) length != length)
{
diff --git a/misc/futimes.c b/misc/futimes.c
index 9459c3a8fb..88f28d4a6d 100644
--- a/misc/futimes.c
+++ b/misc/futimes.c
@@ -1,5 +1,5 @@
/* futimes -- change access and modification times of open file. Stub version.
- Copyright (C) 2002-2015 Free Software Foundation, Inc.
+ Copyright (C) 2002-2016 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
diff --git a/misc/futimesat.c b/misc/futimesat.c
index c675aa5ef1..401b270d83 100644
--- a/misc/futimesat.c
+++ b/misc/futimesat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2016 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
@@ -24,10 +24,7 @@
/* Change the access time of FILE relative to FD to TVP[0] and
the modification time of FILE to TVP[1]. */
int
-futimesat (fd, file, tvp)
- int fd;
- const char *file;
- const struct timeval tvp[2];
+futimesat (int fd, const char *file, const struct timeval tvp[2])
{
if (fd < 0
&& (file == NULL
diff --git a/misc/getauxval.c b/misc/getauxval.c
index c2d850dec7..61113766da 100644
--- a/misc/getauxval.c
+++ b/misc/getauxval.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2016 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
diff --git a/misc/getclktck.c b/misc/getclktck.c
index e16c120b03..c94f3ecef1 100644
--- a/misc/getclktck.c
+++ b/misc/getclktck.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2016 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
diff --git a/misc/getdomain.c b/misc/getdomain.c
index c5ab3a5e5e..8f75cc6c8d 100644
--- a/misc/getdomain.c
+++ b/misc/getdomain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2016 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
@@ -29,9 +29,7 @@
/* The `uname' information includes the domain name. */
int
-getdomainname (name, len)
- char *name;
- size_t len;
+getdomainname (char *name, size_t len)
{
struct utsname u;
size_t u_len;
@@ -47,9 +45,7 @@ getdomainname (name, len)
#else
int
-getdomainname (name, len)
- char *name;
- size_t len;
+getdomainname (char *name, size_t len)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/getdtsz.c b/misc/getdtsz.c
index 182bb9e1e5..5398b79667 100644
--- a/misc/getdtsz.c
+++ b/misc/getdtsz.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/gethostid.c b/misc/gethostid.c
index 30b38f8ef0..70af0b09f7 100644
--- a/misc/gethostid.c
+++ b/misc/gethostid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/gethostname.c b/misc/gethostname.c
index 15097a80ce..f9a508a096 100644
--- a/misc/gethostname.c
+++ b/misc/gethostname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -22,9 +22,7 @@
The result is null-terminated if LEN is large enough for the full
name and the terminator. */
int
-__gethostname (name, len)
- char *name;
- size_t len;
+__gethostname (char *name, size_t len)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/getloadavg.c b/misc/getloadavg.c
index 5fad0e4cbf..9fa3440976 100644
--- a/misc/getloadavg.c
+++ b/misc/getloadavg.c
@@ -1,5 +1,5 @@
/* Get system load averages. Stub version.
- Copyright (C) 1999-2015 Free Software Foundation, Inc.
+ Copyright (C) 1999-2016 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
diff --git a/misc/getpagesize.c b/misc/getpagesize.c
index 93e86194ef..ea795c7742 100644
--- a/misc/getpagesize.c
+++ b/misc/getpagesize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/getpass.c b/misc/getpass.c
index dcaff3855c..7d34796da9 100644
--- a/misc/getpass.c
+++ b/misc/getpass.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2016 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
@@ -24,7 +24,7 @@
#include <wchar.h>
#define flockfile(s) _IO_flockfile (s)
#define funlockfile(s) _IO_funlockfile (s)
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
/* It is desirable to use this bit on systems that have it.
The only bit of terminal state we want to twiddle is echoing, which is
@@ -43,8 +43,7 @@ call_fclose (void *arg)
}
char *
-getpass (prompt)
- const char *prompt;
+getpass (const char *prompt)
{
FILE *in, *out;
struct termios s, t;
diff --git a/misc/getsysstats.c b/misc/getsysstats.c
index d2dc86971c..048e407759 100644
--- a/misc/getsysstats.c
+++ b/misc/getsysstats.c
@@ -1,5 +1,5 @@
/* getsysstats - Determine various system internal values, stub version.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/misc/getttyent.c b/misc/getttyent.c
index fcdbc2274c..d2af870123 100644
--- a/misc/getttyent.c
+++ b/misc/getttyent.c
@@ -142,8 +142,7 @@ weak_alias (__getttyent, getttyent)
*/
static char *
internal_function
-skip(p)
- char *p;
+skip (char *p)
{
char *t;
int c, q;
@@ -177,8 +176,7 @@ skip(p)
static char *
internal_function
-value(p)
- char *p;
+value (char *p)
{
return ((p = index(p, '=')) ? ++p : NULL);
diff --git a/misc/getxattr.c b/misc/getxattr.c
index d90b192bd3..23c70030e2 100644
--- a/misc/getxattr.c
+++ b/misc/getxattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/gtty.c b/misc/gtty.c
index 9a64a9a0dc..2d88455575 100644
--- a/misc/gtty.c
+++ b/misc/gtty.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -21,9 +21,7 @@
/* Fill in *PARAMS with terminal parameters associated with FD. */
int
-gtty (fd, params)
- int fd;
- struct sgttyb *params;
+gtty (int fd, struct sgttyb *params)
{
if (params == NULL)
{
diff --git a/misc/hsearch.c b/misc/hsearch.c
index 7a0b0dc406..80ae881ecd 100644
--- a/misc/hsearch.c
+++ b/misc/hsearch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
This file is part of the GNU C Library.
@@ -24,9 +24,7 @@ static struct hsearch_data htab;
/* Define the non-reentrant function using the reentrant counterparts. */
ENTRY *
-hsearch (item, action)
- ENTRY item;
- ACTION action;
+hsearch (ENTRY item, ACTION action)
{
ENTRY *result;
@@ -37,8 +35,7 @@ hsearch (item, action)
int
-hcreate (nel)
- size_t nel;
+hcreate (size_t nel)
{
return __hcreate_r (nel, &htab);
}
diff --git a/misc/hsearch_r.c b/misc/hsearch_r.c
index 9f55e845cf..1fca6b3222 100644
--- a/misc/hsearch_r.c
+++ b/misc/hsearch_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1993.
@@ -19,7 +19,7 @@
#include <errno.h>
#include <malloc.h>
#include <string.h>
-
+#include <stdint.h>
#include <search.h>
/* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986
@@ -46,15 +46,12 @@ static int
isprime (unsigned int number)
{
/* no even number will be passed */
- unsigned int div = 3;
-
- while (div * div < number && number % div != 0)
- div += 2;
-
- return number % div != 0;
+ for (unsigned int div = 3; div <= number / div; div += 2)
+ if (number % div == 0)
+ return 0;
+ return 1;
}
-
/* Before using the hash table we must allocate memory for it.
Test for an existing table are done. We allocate one element
more as the found prime number says. This is done for more effective
@@ -62,9 +59,7 @@ isprime (unsigned int number)
The contents of the table is zeroed, especially the field used
becomes zero. */
int
-__hcreate_r (nel, htab)
- size_t nel;
- struct hsearch_data *htab;
+__hcreate_r (size_t nel, struct hsearch_data *htab)
{
/* Test for correct arguments. */
if (htab == NULL)
@@ -81,10 +76,19 @@ __hcreate_r (nel, htab)
use will not work. */
if (nel < 3)
nel = 3;
- /* Change nel to the first prime number not smaller as nel. */
- nel |= 1; /* make odd */
- while (!isprime (nel))
- nel += 2;
+
+ /* Change nel to the first prime number in the range [nel, UINT_MAX - 2],
+ The '- 2' means 'nel += 2' cannot overflow. */
+ for (nel |= 1; ; nel += 2)
+ {
+ if (UINT_MAX - 2 < nel)
+ {
+ __set_errno (ENOMEM);
+ return 0;
+ }
+ if (isprime (nel))
+ break;
+ }
htab->size = nel;
htab->filled = 0;
@@ -104,8 +108,7 @@ weak_alias (__hcreate_r, hcreate_r)
/* After using the hash table it has to be destroyed. The used memory can
be freed and the local static variable can be marked as not used. */
void
-__hdestroy_r (htab)
- struct hsearch_data *htab;
+__hdestroy_r (struct hsearch_data *htab)
{
/* Test for correct arguments. */
if (htab == NULL)
@@ -138,11 +141,8 @@ weak_alias (__hdestroy_r, hdestroy_r)
equality of the stored and the parameter value. This helps to prevent
unnecessary expensive calls of strcmp. */
int
-__hsearch_r (item, action, retval, htab)
- ENTRY item;
- ACTION action;
- ENTRY **retval;
- struct hsearch_data *htab;
+__hsearch_r (ENTRY item, ACTION action, ENTRY **retval,
+ struct hsearch_data *htab)
{
unsigned int hval;
unsigned int count;
diff --git a/misc/ifunc-impl-list.c b/misc/ifunc-impl-list.c
index 446c74f736..11a1becbd1 100644
--- a/misc/ifunc-impl-list.c
+++ b/misc/ifunc-impl-list.c
@@ -1,5 +1,5 @@
/* Enumerate available IFUNC implementations of a function. Stub version.
- Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ Copyright (C) 2012-2016 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
diff --git a/misc/init-misc.c b/misc/init-misc.c
index 9254f02903..a9bf1da74a 100644
--- a/misc/init-misc.c
+++ b/misc/init-misc.c
@@ -1,5 +1,5 @@
/* Define and initialize `__progname' et. al.
- Copyright (C) 1994-2015 Free Software Foundation, Inc.
+ Copyright (C) 1994-2016 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
diff --git a/misc/insremque.c b/misc/insremque.c
index 3c56f514b6..cb435dc0df 100644
--- a/misc/insremque.c
+++ b/misc/insremque.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2016 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
diff --git a/misc/ioctl.c b/misc/ioctl.c
index f75f3e41b2..a6ba0879e1 100644
--- a/misc/ioctl.c
+++ b/misc/ioctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -21,9 +21,7 @@
/* Perform the I/O control operation specified by REQUEST on FD.
The actual type and use of ARG and the return value depend on REQUEST. */
int
-__ioctl (fd, request)
- int fd;
- unsigned long int request;
+__ioctl (int fd, unsigned long int request, ...)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/lgetxattr.c b/misc/lgetxattr.c
index f6e9a514d1..bddbfa3468 100644
--- a/misc/lgetxattr.c
+++ b/misc/lgetxattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/libgen.h b/misc/libgen.h
index 964a72f1b4..38f4d195d3 100644
--- a/misc/libgen.h
+++ b/misc/libgen.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2016 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
diff --git a/misc/listxattr.c b/misc/listxattr.c
index a09565edbc..b5dafa57ba 100644
--- a/misc/listxattr.c
+++ b/misc/listxattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/llistxattr.c b/misc/llistxattr.c
index e9820760d1..7efcf91e85 100644
--- a/misc/llistxattr.c
+++ b/misc/llistxattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/lremovexattr.c b/misc/lremovexattr.c
index 85532817e1..6c48e69f07 100644
--- a/misc/lremovexattr.c
+++ b/misc/lremovexattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/lsearch.c b/misc/lsearch.c
index 08ade2b69f..3873638a1d 100644
--- a/misc/lsearch.c
+++ b/misc/lsearch.c
@@ -1,5 +1,5 @@
/* Linear search functions.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/misc/lsetxattr.c b/misc/lsetxattr.c
index ea6bb7e5ce..28d10a094c 100644
--- a/misc/lsetxattr.c
+++ b/misc/lsetxattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/lutimes.c b/misc/lutimes.c
index 76d13bfef6..ed15db7108 100644
--- a/misc/lutimes.c
+++ b/misc/lutimes.c
@@ -1,5 +1,5 @@
/* lutimes -- change access and modification times of a symlink. Stub version.
- Copyright (C) 2002-2015 Free Software Foundation, Inc.
+ Copyright (C) 2002-2016 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
diff --git a/misc/madvise.c b/misc/madvise.c
index 55f82d0491..91674bd769 100644
--- a/misc/madvise.c
+++ b/misc/madvise.c
@@ -1,5 +1,5 @@
/* Advise system about intentions for a memory region. Stub version.
- Copyright (C) 1994-2015 Free Software Foundation, Inc.
+ Copyright (C) 1994-2016 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
diff --git a/misc/mincore.c b/misc/mincore.c
index ea54670add..f01aa983a6 100644
--- a/misc/mincore.c
+++ b/misc/mincore.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2016 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
diff --git a/misc/mkdtemp.c b/misc/mkdtemp.c
index 1f733cdfaa..34dde72d42 100644
--- a/misc/mkdtemp.c
+++ b/misc/mkdtemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2016 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
@@ -24,8 +24,7 @@
The directory is created, mode 700, and its name is returned.
(This function comes from OpenBSD.) */
char *
-mkdtemp (template)
- char *template;
+mkdtemp (char *template)
{
if (__gen_tempname (template, 0, 0, __GT_DIR))
return NULL;
diff --git a/misc/mkostemp.c b/misc/mkostemp.c
index 807e4770a0..c990bbd75b 100644
--- a/misc/mkostemp.c
+++ b/misc/mkostemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2016 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
@@ -27,9 +27,7 @@
they are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
int
-mkostemp (template, flags)
- char *template;
- int flags;
+mkostemp (char *template, int flags)
{
return __gen_tempname (template, 0, flags, __GT_FILE);
}
diff --git a/misc/mkostemp64.c b/misc/mkostemp64.c
index 2b9c868cd0..0c32c908e6 100644
--- a/misc/mkostemp64.c
+++ b/misc/mkostemp64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2016 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
@@ -27,9 +27,7 @@
they are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
int
-mkostemp64 (template, flags)
- char *template;
- int flags;
+mkostemp64 (char *template, int flags)
{
return __gen_tempname (template, 0, flags | O_LARGEFILE, __GT_FILE);
}
diff --git a/misc/mkostemps.c b/misc/mkostemps.c
index 892dc69ba2..fcc6053ef3 100644
--- a/misc/mkostemps.c
+++ b/misc/mkostemps.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2016 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
@@ -28,10 +28,7 @@
"XXXXXX"; they are replaced with a string that makes the filename
unique. Then open the file and return a fd. */
int
-mkostemps (template, suffixlen, flags)
- char *template;
- int suffixlen;
- int flags;
+mkostemps (char *template, int suffixlen, int flags)
{
if (suffixlen < 0)
{
diff --git a/misc/mkostemps64.c b/misc/mkostemps64.c
index 7b48b5c8c0..4351978d70 100644
--- a/misc/mkostemps64.c
+++ b/misc/mkostemps64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2016 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
@@ -28,10 +28,7 @@
"XXXXXX"; they are replaced with a string that makes the filename
unique. Then open the file and return a fd. */
int
-mkostemps64 (template, suffixlen, flags)
- char *template;
- int suffixlen;
- int flags;
+mkostemps64 (char *template, int suffixlen, int flags)
{
if (suffixlen < 0)
{
diff --git a/misc/mkstemp.c b/misc/mkstemp.c
index c5018d154a..69c6c00b79 100644
--- a/misc/mkstemp.c
+++ b/misc/mkstemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2016 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
@@ -27,8 +27,7 @@
they are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
int
-mkstemp (template)
- char *template;
+mkstemp (char *template)
{
return __gen_tempname (template, 0, 0, __GT_FILE);
}
diff --git a/misc/mkstemp64.c b/misc/mkstemp64.c
index e4b8605950..b09c590850 100644
--- a/misc/mkstemp64.c
+++ b/misc/mkstemp64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2016 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
@@ -27,8 +27,7 @@
they are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
int
-mkstemp64 (template)
- char *template;
+mkstemp64 (char *template)
{
return __gen_tempname (template, 0, O_LARGEFILE, __GT_FILE);
}
diff --git a/misc/mkstemps.c b/misc/mkstemps.c
index ca17d1d71a..1f46ef57fe 100644
--- a/misc/mkstemps.c
+++ b/misc/mkstemps.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2016 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
@@ -28,9 +28,7 @@
"XXXXXX"; they are replaced with a string that makes the filename
unique. Then open the file and return a fd. */
int
-mkstemps (template, suffixlen)
- char *template;
- int suffixlen;
+mkstemps (char *template, int suffixlen)
{
if (suffixlen < 0)
{
diff --git a/misc/mkstemps64.c b/misc/mkstemps64.c
index dd786f13ab..93b7adbea3 100644
--- a/misc/mkstemps64.c
+++ b/misc/mkstemps64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2016 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
@@ -28,9 +28,7 @@
"XXXXXX"; they are replaced with a string that makes the filename
unique. Then open the file and return a fd. */
int
-mkstemps64 (template, suffixlen)
- char *template;
- int suffixlen;
+mkstemps64 (char *template, int suffixlen)
{
if (suffixlen < 0)
{
diff --git a/misc/mktemp.c b/misc/mktemp.c
index fc82ede790..f14e10a0d3 100644
--- a/misc/mktemp.c
+++ b/misc/mktemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2016 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
@@ -22,8 +22,7 @@
The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the filename unique. */
char *
-__mktemp (template)
- char *template;
+__mktemp (char *template)
{
if (__gen_tempname (template, 0, 0, __GT_NOCREATE) < 0)
/* We return the null string if we can't find a unique file name. */
@@ -33,4 +32,5 @@ __mktemp (template)
}
weak_alias (__mktemp, mktemp)
-link_warning (mktemp, "the use of `mktemp' is dangerous, better use `mkstemp'")
+link_warning (mktemp, "the use of `mktemp' is dangerous, "
+ "better use `mkstemp' or `mkdtemp'")
diff --git a/misc/mlock.c b/misc/mlock.c
index c84ca2e077..acca6dba2a 100644
--- a/misc/mlock.c
+++ b/misc/mlock.c
@@ -1,5 +1,5 @@
/* mlock -- guarantee pages are resident in memory. Stub version.
- Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ Copyright (C) 2001-2016 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
diff --git a/misc/mlockall.c b/misc/mlockall.c
index be3e4f897d..62bc07ce46 100644
--- a/misc/mlockall.c
+++ b/misc/mlockall.c
@@ -1,5 +1,5 @@
/* mlockall -- lock in core all the pages in this process. Stub version.
- Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ Copyright (C) 2001-2016 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
diff --git a/misc/mmap.c b/misc/mmap.c
index 9447067fcb..6e96cbbacd 100644
--- a/misc/mmap.c
+++ b/misc/mmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2016 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
diff --git a/misc/mmap64.c b/misc/mmap64.c
index 1797ed401b..8c0faa5e0d 100644
--- a/misc/mmap64.c
+++ b/misc/mmap64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2016 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
diff --git a/misc/mntent.c b/misc/mntent.c
index 7dedc62387..d1828bdc0f 100644
--- a/misc/mntent.c
+++ b/misc/mntent.c
@@ -1,5 +1,5 @@
/* Utilities for reading/writing fstab, mtab, etc.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
@@ -18,7 +18,7 @@
#include <mntent.h>
#include <stdlib.h>
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
/* We don't want to allocate the static buffer all the time since it
is not always used (in fact, rather infrequently). Accept the
diff --git a/misc/mntent.h b/misc/mntent.h
index cddb074ec6..43c083b146 100644
--- a/misc/mntent.h
+++ b/misc/mntent.h
@@ -1,5 +1,5 @@
/* Utilities for reading/writing fstab, mtab, etc.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
diff --git a/misc/mntent_r.c b/misc/mntent_r.c
index 615987347a..4ca42e6dbc 100644
--- a/misc/mntent_r.c
+++ b/misc/mntent_r.c
@@ -1,5 +1,5 @@
/* Utilities for reading/writing fstab, mtab, etc.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
@@ -136,7 +136,9 @@ __getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz)
end_ptr = strchr (buffer, '\n');
if (end_ptr != NULL) /* chop newline */
{
- while (end_ptr[-1] == ' ' || end_ptr[-1] == '\t')
+ /* Do not walk past the start of buffer if it's all whitespace. */
+ while (end_ptr != buffer
+ && (end_ptr[-1] == ' ' || end_ptr[-1] == '\t'))
end_ptr--;
*end_ptr = '\0';
}
diff --git a/misc/mprotect.c b/misc/mprotect.c
index 64a72c4580..34251b0694 100644
--- a/misc/mprotect.c
+++ b/misc/mprotect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2016 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
diff --git a/misc/msync.c b/misc/msync.c
index 82589dd972..6db8ee8df5 100644
--- a/misc/msync.c
+++ b/misc/msync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2016 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
diff --git a/misc/munlock.c b/misc/munlock.c
index 50f3ae4b85..f6d1e160fd 100644
--- a/misc/munlock.c
+++ b/misc/munlock.c
@@ -1,5 +1,5 @@
/* munlock -- undo the effects of prior mlock calls. Stub version.
- Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ Copyright (C) 2001-2016 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
diff --git a/misc/munlockall.c b/misc/munlockall.c
index 0c26450928..66ed33292d 100644
--- a/misc/munlockall.c
+++ b/misc/munlockall.c
@@ -1,5 +1,5 @@
/* munlockall -- undo the effects of all prior mlock calls. Stub version.
- Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ Copyright (C) 2001-2016 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
diff --git a/misc/munmap.c b/misc/munmap.c
index 2f42b1aacb..d6d2d3ac10 100644
--- a/misc/munmap.c
+++ b/misc/munmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2016 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
diff --git a/misc/preadv.c b/misc/preadv.c
index 36296e3e98..7ecebdbedf 100644
--- a/misc/preadv.c
+++ b/misc/preadv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2016 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
@@ -26,11 +26,7 @@
'pread' (see <unistd.h>) except that data are put in VECTOR instead
of a contiguous buffer. */
ssize_t
-preadv (fd, vector, count, offset)
- int fd;
- const struct iovec *vector;
- int count;
- off_t offset;
+preadv (int fd, const struct iovec *vector, int count, off_t offset)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/preadv64.c b/misc/preadv64.c
index d73ad87357..9326c92244 100644
--- a/misc/preadv64.c
+++ b/misc/preadv64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2016 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
@@ -26,11 +26,7 @@
'pread' (see <unistd.h>) except that data are put in VECTOR instead
of a contiguous buffer. */
ssize_t
-preadv64 (fd, vector, count, offset)
- int fd;
- const struct iovec *vector;
- int count;
- off64_t offset;
+preadv64 (int fd, const struct iovec *vector, int count, off64_t offset)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/pselect.c b/misc/pselect.c
index 2f8d0a3edf..bfced60473 100644
--- a/misc/pselect.c
+++ b/misc/pselect.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/misc/ptrace.c b/misc/ptrace.c
index 095ad3fe18..1a97062e27 100644
--- a/misc/ptrace.c
+++ b/misc/ptrace.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/pwritev.c b/misc/pwritev.c
index 0b09809a48..405cad3bdd 100644
--- a/misc/pwritev.c
+++ b/misc/pwritev.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2016 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
@@ -26,11 +26,7 @@
<unistd.h>) except that the data are taken from VECTOR instead of a
contiguous buffer. */
ssize_t
-pwritev (fd, vector, count, offset)
- int fd;
- const struct iovec *vector;
- int count;
- off_t offset;
+pwritev (int fd, const struct iovec *vector, int count, off_t offset)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/pwritev64.c b/misc/pwritev64.c
index 8201b2c5f1..ce88f0e62d 100644
--- a/misc/pwritev64.c
+++ b/misc/pwritev64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2016 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
@@ -26,11 +26,7 @@
<unistd.h>) except that the data are taken from VECTOR instead of a
contiguous buffer. */
ssize_t
-pwritev64 (fd, vector, count, offset)
- int fd;
- const struct iovec *vector;
- int count;
- off64_t offset;
+pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/qefgcvt.c b/misc/qefgcvt.c
index bc884a6686..6e082c28be 100644
--- a/misc/qefgcvt.c
+++ b/misc/qefgcvt.c
@@ -1,5 +1,5 @@
/* Compatibility functions for floating point formatting, long double version.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 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
diff --git a/misc/qefgcvt_r.c b/misc/qefgcvt_r.c
index 77a76280ff..0c0bc0d1f2 100644
--- a/misc/qefgcvt_r.c
+++ b/misc/qefgcvt_r.c
@@ -1,6 +1,6 @@
/* Compatibility functions for floating point formatting, reentrant,
long double versions.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 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
diff --git a/misc/readv.c b/misc/readv.c
index de78708dc6..c0bdb0ebf0 100644
--- a/misc/readv.c
+++ b/misc/readv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -25,10 +25,7 @@
Operates just like `read' (see <unistd.h>) except that data are
put in VECTOR instead of a contiguous buffer. */
ssize_t
-__readv (fd, vector, count)
- int fd;
- const struct iovec *vector;
- int count;
+__readv (int fd, const struct iovec *vector, int count)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/reboot.c b/misc/reboot.c
index de70662491..2391309876 100644
--- a/misc/reboot.c
+++ b/misc/reboot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2016 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
diff --git a/misc/regexp.c b/misc/regexp.c
index ee7d572111..3b3668272f 100644
--- a/misc/regexp.c
+++ b/misc/regexp.c
@@ -1,5 +1,5 @@
-/* Define function and variables for the obsolete <regexp.h> interface.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+/* Compatibility symbols for the obsolete <regexp.h> interface.
+ Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -17,17 +17,27 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* We don't include regexp.h here because of the macros it requires, and
- because it now contains an unconditional #warning. */
+/* regexp.h now contains only an #error directive, so it cannot be
+ used in this file.
+
+ The function that would produce an 'expbuf' to use as the second
+ argument to 'step' and 'advance' was defined only in regexp.h,
+ as its definition depended on macros defined by the user. */
#include <regex.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
/* Define the variables used for the interface. */
char *loc1;
char *loc2;
+compat_symbol (libc, loc1, loc1, GLIBC_2_0);
+compat_symbol (libc, loc2, loc2, GLIBC_2_0);
/* Although we do not support the use we define this variable as well. */
char *locs;
+compat_symbol (libc, locs, locs, GLIBC_2_0);
/* Find the next match in STRING. The compiled regular expression is
@@ -35,7 +45,8 @@ char *locs;
first character matched and `loc2' points to the next unmatched
character. */
int
-__step (const char *string, const char *expbuf)
+weak_function attribute_compat_text_section
+step (const char *string, const char *expbuf)
{
regmatch_t match; /* We only need info about the full match. */
@@ -50,14 +61,15 @@ __step (const char *string, const char *expbuf)
loc2 = (char *) string + match.rm_eo;
return 1;
}
-weak_alias (__step, step)
+compat_symbol (libc, step, step, GLIBC_2_0);
/* Match the beginning of STRING with the compiled regular expression
in EXPBUF. If the match is successful `loc2' will contain the
position of the first unmatched character. */
int
-__advance (const char *string, const char *expbuf)
+weak_function attribute_compat_text_section
+advance (const char *string, const char *expbuf)
{
regmatch_t match; /* We only need info about the full match. */
@@ -74,4 +86,7 @@ __advance (const char *string, const char *expbuf)
loc2 = (char *) string + match.rm_eo;
return 1;
}
-weak_alias (__advance, advance)
+compat_symbol (libc, advance, advance, GLIBC_2_0);
+
+
+#endif /* SHLIB_COMPAT (2.0, 2.23) */
diff --git a/misc/regexp.h b/misc/regexp.h
index 346098945d..6d3bc3075c 100644
--- a/misc/regexp.h
+++ b/misc/regexp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -19,211 +19,15 @@
#ifndef _REGEXP_H
#define _REGEXP_H 1
-/* The contents of this header file were standardized in the
- Single Unix Specification, Version 2 (1997) but marked as
- LEGACY; new applications were already being encouraged to
- use <regex.h> instead. POSIX.1-2001 removed this header.
+/* The contents of this header file were originally standardized in
+ the Single Unix Specification, Issue 3 (1992). In Issue 4 (1994)
+ the header was marked as TO BE WITHDRAWN, and new applications
+ were encouraged to use <regex.h> instead. It was officially
+ withdrawn from the standard in Issue 6 (aka POSIX.1-2001).
- This header is provided only for backward compatibility.
- It will be removed in the next release of the GNU C Library.
- New code should use <regex.h> instead. */
+ The GNU C Library provided this header through version 2.22. */
-#warning "<regexp.h> will be removed in the next release of the GNU C Library."
-#warning "Please update your code to use <regex.h> instead (no trailing 'p')."
-
-#include <features.h>
-#include <alloca.h>
-#include <regex.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* The implementation provided here emulates the needed functionality
- by mapping to the POSIX regular expression matcher. The interface
- for the here included function is weird (this really is a harmless
- word).
-
- The user has to provide six macros before this header file can be
- included:
-
- INIT Declarations vor variables which can be used by the
- other macros.
-
- GETC() Return the value of the next character in the regular
- expression pattern. Successive calls should return
- successive characters.
-
- PEEKC() Return the value of the next character in the regular
- expression pattern. Immediately successive calls to
- PEEKC() should return the same character which should
- also be the next character returned by GETC().
-
- UNGETC(c) Cause `c' to be returned by the next call to GETC() and
- PEEKC().
-
- RETURN(ptr) Used for normal exit of the `compile' function. `ptr'
- is a pointer to the character after the last character of
- the compiled regular expression.
-
- ERROR(val) Used for abnormal return from `compile'. `val' is the
- error number. The error codes are:
- 11 Range endpoint too large.
- 16 Bad number.
- 25 \digit out of range.
- 36 Illegal or missing delimiter.
- 41 No remembered search string.
- 42 \( \) imbalance.
- 43 Too many \(.
- 44 More tan two numbers given in \{ \}.
- 45 } expected after \.
- 46 First number exceeds second in \{ \}.
- 49 [ ] imbalance.
- 50 Regular expression overflow.
-
- */
-
-__BEGIN_DECLS
-
-/* Interface variables. They contain the results of the successful
- calls to `setp' and `advance'. */
-extern char *loc1;
-extern char *loc2;
-
-/* The use of this variable in the `advance' function is not
- supported. */
-extern char *locs;
-
-
-#ifndef __DO_NOT_DEFINE_COMPILE
-/* Get and compile the user supplied pattern up to end of line or
- string or until EOF is seen, whatever happens first. The result is
- placed in the buffer starting at EXPBUF and delimited by ENDBUF.
-
- This function cannot be defined in the libc itself since it depends
- on the macros. */
-char *
-compile (char *__restrict instring, char *__restrict expbuf,
- const char *__restrict endbuf, int eof)
-{
- char *__input_buffer = NULL;
- size_t __input_size = 0;
- size_t __current_size = 0;
- int __ch;
- int __error;
- INIT
-
- /* Align the expression buffer according to the needs for an object
- of type `regex_t'. Then check for minimum size of the buffer for
- the compiled regular expression. */
- regex_t *__expr_ptr;
-# if defined __GNUC__ && __GNUC__ >= 2
- const size_t __req = __alignof__ (regex_t *);
-# else
- /* How shall we find out? We simply guess it and can change it is
- this really proofs to be wrong. */
- const size_t __req = 8;
-# endif
- expbuf += __req;
- expbuf -= (expbuf - ((char *) 0)) % __req;
- if (endbuf < expbuf + sizeof (regex_t))
- {
- ERROR (50);
- }
- __expr_ptr = (regex_t *) expbuf;
- /* The remaining space in the buffer can be used for the compiled
- pattern. */
- __expr_ptr->__REPB_PREFIX (buffer) = expbuf + sizeof (regex_t);
- __expr_ptr->__REPB_PREFIX (allocated)
- = endbuf - (char *) __expr_ptr->__REPB_PREFIX (buffer);
-
- while ((__ch = (GETC ())) != eof)
- {
- if (__ch == '\0' || __ch == '\n')
- {
- UNGETC (__ch);
- break;
- }
-
- if (__current_size + 1 >= __input_size)
- {
- size_t __new_size = __input_size ? 2 * __input_size : 128;
- char *__new_room = (char *) alloca (__new_size);
- /* See whether we can use the old buffer. */
- if (__new_room + __new_size == __input_buffer)
- {
- __input_size += __new_size;
- __input_buffer = (char *) memcpy (__new_room, __input_buffer,
- __current_size);
- }
- else if (__input_buffer + __input_size == __new_room)
- __input_size += __new_size;
- else
- {
- __input_size = __new_size;
- __input_buffer = (char *) memcpy (__new_room, __input_buffer,
- __current_size);
- }
- }
- __input_buffer[__current_size++] = __ch;
- }
- if (__current_size)
- __input_buffer[__current_size++] = '\0';
- else
- __input_buffer = "";
-
- /* Now compile the pattern. */
- __error = regcomp (__expr_ptr, __input_buffer, REG_NEWLINE);
- if (__error != 0)
- /* Oh well, we have to translate POSIX error codes. */
- switch (__error)
- {
- case REG_BADPAT:
- case REG_ECOLLATE:
- case REG_ECTYPE:
- case REG_EESCAPE:
- case REG_BADRPT:
- case REG_EEND:
- case REG_ERPAREN:
- default:
- /* There is no matching error code. */
- ERROR (36);
- case REG_ESUBREG:
- ERROR (25);
- case REG_EBRACK:
- ERROR (49);
- case REG_EPAREN:
- ERROR (42);
- case REG_EBRACE:
- ERROR (44);
- case REG_BADBR:
- ERROR (46);
- case REG_ERANGE:
- ERROR (11);
- case REG_ESPACE:
- case REG_ESIZE:
- ERROR (50);
- }
-
- /* Everything is ok. */
- RETURN ((char *) (__expr_ptr->__REPB_PREFIX (buffer)
- + __expr_ptr->__REPB_PREFIX (used)));
-}
-#endif
-
-
-/* Find the next match in STRING. The compiled regular expression is
- found in the buffer starting at EXPBUF. `loc1' will return the
- first character matched and `loc2' points to the next unmatched
- character. */
-extern int step (const char *__restrict __string,
- const char *__restrict __expbuf) __THROW;
-
-/* Match the beginning of STRING with the compiled regular expression
- in EXPBUF. If the match is successful `loc2' will contain the
- position of the first unmatched character. */
-extern int advance (const char *__restrict __string,
- const char *__restrict __expbuf) __THROW;
-
-
-__END_DECLS
+#error "The GNU C Library no longer implements <regexp.h>."
+#error "Please update your code to use <regex.h> instead (no trailing 'p')."
#endif /* regexp.h */
diff --git a/misc/remap_file_pages.c b/misc/remap_file_pages.c
index 6440726e8e..7c2352ebb7 100644
--- a/misc/remap_file_pages.c
+++ b/misc/remap_file_pages.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2003-2016 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
diff --git a/misc/removexattr.c b/misc/removexattr.c
index 26bfb0b58a..3d18a92079 100644
--- a/misc/removexattr.c
+++ b/misc/removexattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/revoke.c b/misc/revoke.c
index 2baf5d6911..2c395e9639 100644
--- a/misc/revoke.c
+++ b/misc/revoke.c
@@ -1,5 +1,5 @@
/* Revoke the access of all descriptors currently open on a file.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
@@ -20,8 +20,7 @@
#include <errno.h>
int
-revoke (file)
- const char *file;
+revoke (const char *file)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/sbrk.c b/misc/sbrk.c
index 89ab9c4a8c..4948dbfce6 100644
--- a/misc/sbrk.c
+++ b/misc/sbrk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/search.h b/misc/search.h
index 60e37463e8..bbf4b1d325 100644
--- a/misc/search.h
+++ b/misc/search.h
@@ -1,5 +1,5 @@
/* Declarations for System V style searching functions.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
diff --git a/misc/select.c b/misc/select.c
index e5cd18e4e0..320afb848f 100644
--- a/misc/select.c
+++ b/misc/select.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -25,12 +25,8 @@
after waiting the interval specified therein. Returns the number of ready
descriptors, or -1 for errors. */
int
-__select (nfds, readfds, writefds, exceptfds, timeout)
- int nfds;
- fd_set *readfds;
- fd_set *writefds;
- fd_set *exceptfds;
- struct timeval *timeout;
+__select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+ struct timeval *timeout)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/setdomain.c b/misc/setdomain.c
index 3cc03b1a1c..e4053c07ec 100644
--- a/misc/setdomain.c
+++ b/misc/setdomain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2016 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
@@ -21,9 +21,7 @@
/* Set the name of the current YP domain to NAME, which is LEN bytes long.
This call is restricted to the super-user. */
int
-setdomainname (name, len)
- const char *name;
- size_t len;
+setdomainname (const char *name, size_t len)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/setegid.c b/misc/setegid.c
index 37a3b6ac63..81fe42c9f9 100644
--- a/misc/setegid.c
+++ b/misc/setegid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2016 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
@@ -20,8 +20,7 @@
/* Set the effective group ID of the calling process to GID. */
int
-setegid (gid)
- __gid_t gid;
+setegid (__gid_t gid)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/seteuid.c b/misc/seteuid.c
index af92bcdb8c..e6c53b6882 100644
--- a/misc/seteuid.c
+++ b/misc/seteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2016 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
@@ -20,8 +20,7 @@
/* Set the effective user ID of the calling process to UID. */
int
-seteuid (uid)
- __uid_t uid;
+seteuid (__uid_t uid)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/sethostid.c b/misc/sethostid.c
index 96c750ea75..0010012e94 100644
--- a/misc/sethostid.c
+++ b/misc/sethostid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -21,8 +21,7 @@
/* Set the current machine's Internet number to ID.
This call is restricted to the super-user. */
int
-sethostid (id)
- long int id;
+sethostid (long int id)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/sethostname.c b/misc/sethostname.c
index c6c1440c7b..6fb15b4248 100644
--- a/misc/sethostname.c
+++ b/misc/sethostname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -21,9 +21,7 @@
/* Set the name of the current host to NAME, which is LEN bytes long.
This call is restricted to the super-user. */
int
-sethostname (name, len)
- const char *name;
- size_t len;
+sethostname (const char *name, size_t len)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/setregid.c b/misc/setregid.c
index 692bff0105..2f4f51a186 100644
--- a/misc/setregid.c
+++ b/misc/setregid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -22,9 +22,7 @@
/* Set the real group ID of the calling process to RGID,
and the effective group ID of the calling process to EGID. */
int
-__setregid (effective_gid, real_gid)
- gid_t effective_gid;
- gid_t real_gid;
+__setregid (gid_t effective_gid, gid_t real_gid)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/setreuid.c b/misc/setreuid.c
index a6290f0eeb..d7e35cf9c6 100644
--- a/misc/setreuid.c
+++ b/misc/setreuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -22,9 +22,7 @@
/* Set the real user ID of the calling process to RUID,
and the effective user ID of the calling process to EUID. */
int
-__setreuid (effective_uid, real_uid)
- uid_t effective_uid;
- uid_t real_uid;
+__setreuid (uid_t effective_uid, uid_t real_uid)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/setxattr.c b/misc/setxattr.c
index 148f78703b..09fe443dd9 100644
--- a/misc/setxattr.c
+++ b/misc/setxattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/sgtty.h b/misc/sgtty.h
index ec08a7cfcc..121cd26638 100644
--- a/misc/sgtty.h
+++ b/misc/sgtty.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/sstk.c b/misc/sstk.c
index 437deb173e..d7527be7e5 100644
--- a/misc/sstk.c
+++ b/misc/sstk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -23,8 +23,7 @@
void *sstk (int increment) __THROW;
void *
-sstk (increment)
- int increment;
+sstk (int increment)
{
__set_errno (ENOSYS);
return (void *) -1;
diff --git a/misc/stty.c b/misc/stty.c
index 0ce3e60e17..6d2687d1f3 100644
--- a/misc/stty.c
+++ b/misc/stty.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -21,9 +21,7 @@
/* Set the terminal parameters associated with FD to *PARAMS. */
int
-stty (fd, params)
- int fd;
- const struct sgttyb *params;
+stty (int fd, const struct sgttyb *params)
{
if (params == NULL)
{
diff --git a/misc/swapoff.c b/misc/swapoff.c
index c5ef7e2180..448033381f 100644
--- a/misc/swapoff.c
+++ b/misc/swapoff.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2016 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
diff --git a/misc/swapon.c b/misc/swapon.c
index aadb910a12..d05bdc53fb 100644
--- a/misc/swapon.c
+++ b/misc/swapon.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/sync.c b/misc/sync.c
index 9e437e76a9..2bb75b6551 100644
--- a/misc/sync.c
+++ b/misc/sync.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/syncfs.c b/misc/syncfs.c
index e9460569af..f5b64cbaa7 100644
--- a/misc/syncfs.c
+++ b/misc/syncfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2016 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
diff --git a/misc/sys/auxv.h b/misc/sys/auxv.h
index 81b1918477..73d48916d7 100644
--- a/misc/sys/auxv.h
+++ b/misc/sys/auxv.h
@@ -1,5 +1,5 @@
/* Access to the auxiliary vector.
- Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ Copyright (C) 2012-2016 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
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 99e94cce86..7fd41549db 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2016 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
diff --git a/misc/sys/dir.h b/misc/sys/dir.h
index 1ffcd2a338..73b04bf4c6 100644
--- a/misc/sys/dir.h
+++ b/misc/sys/dir.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/sys/file.h b/misc/sys/file.h
index acaffe704f..cd2a6410fc 100644
--- a/misc/sys/file.h
+++ b/misc/sys/file.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/sys/ioctl.h b/misc/sys/ioctl.h
index b4bf0bd5f8..4bc5a1a976 100644
--- a/misc/sys/ioctl.h
+++ b/misc/sys/ioctl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/sys/mman.h b/misc/sys/mman.h
index 56e31b718d..a7879eafd3 100644
--- a/misc/sys/mman.h
+++ b/misc/sys/mman.h
@@ -1,5 +1,5 @@
/* Definitions for BSD-style memory management.
- Copyright (C) 1994-2015 Free Software Foundation, Inc.
+ Copyright (C) 1994-2016 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
diff --git a/misc/sys/param.h b/misc/sys/param.h
index 62b7ed26f4..7e0e331450 100644
--- a/misc/sys/param.h
+++ b/misc/sys/param.h
@@ -1,5 +1,5 @@
/* Compatibility header for old-style Unix parameters and limits.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
@@ -50,6 +50,9 @@
#if !defined NOFILE && defined OPEN_MAX
# define NOFILE OPEN_MAX
#endif
+#if !defined MAXHOSTNAMELEN && defined HOST_NAME_MAX
+# define MAXHOSTNAMELEN HOST_NAME_MAX
+#endif
#ifndef NCARGS
# ifdef ARG_MAX
# define NCARGS ARG_MAX
diff --git a/misc/sys/select.h b/misc/sys/select.h
index 313107dcb8..b852dac2d8 100644
--- a/misc/sys/select.h
+++ b/misc/sys/select.h
@@ -1,5 +1,5 @@
/* `fd_set' type and related macros, and `select'/`pselect' declarations.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 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
diff --git a/misc/sys/uio.h b/misc/sys/uio.h
index 928f327de1..2c98077c57 100644
--- a/misc/sys/uio.h
+++ b/misc/sys/uio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/sys/ustat.h b/misc/sys/ustat.h
index 0b811a2762..b58a1def7c 100644
--- a/misc/sys/ustat.h
+++ b/misc/sys/ustat.h
@@ -1,5 +1,5 @@
/* Header describing obsolete `ustat' interface.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 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
diff --git a/misc/sys/xattr.h b/misc/sys/xattr.h
index 29ba1da6e4..0bdce5721f 100644
--- a/misc/sys/xattr.h
+++ b/misc/sys/xattr.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2016 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
diff --git a/misc/syscall.c b/misc/syscall.c
index 7590ad3044..35eec2ab12 100644
--- a/misc/syscall.c
+++ b/misc/syscall.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2016 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
@@ -23,8 +23,7 @@
This only makes sense in certain operating systems. */
long int
-syscall (callno)
- long int callno;
+syscall (long int callno, ...)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/syslog.c b/misc/syslog.c
index 9dd4cde18c..6922ad685c 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -47,7 +47,7 @@ static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
#include <signal.h>
#include <locale.h>
@@ -346,36 +346,9 @@ openlog_internal(const char *ident, int logstat, int logfac)
(void)strncpy(SyslogAddr.sun_path, _PATH_LOG,
sizeof(SyslogAddr.sun_path));
if (LogStat & LOG_NDELAY) {
-#ifdef SOCK_CLOEXEC
-# ifndef __ASSUME_SOCK_CLOEXEC
- if (__have_sock_cloexec >= 0) {
-# endif
- LogFile = __socket(AF_UNIX,
- LogType
- | SOCK_CLOEXEC, 0);
-# ifndef __ASSUME_SOCK_CLOEXEC
- if (__have_sock_cloexec == 0)
- __have_sock_cloexec
- = ((LogFile != -1
- || errno != EINVAL)
- ? 1 : -1);
- }
-# endif
-#endif
-#ifndef __ASSUME_SOCK_CLOEXEC
-# ifdef SOCK_CLOEXEC
- if (__have_sock_cloexec < 0)
-# endif
- LogFile = __socket(AF_UNIX, LogType, 0);
-#endif
- if (LogFile == -1)
- return;
-#ifndef __ASSUME_SOCK_CLOEXEC
-# ifdef SOCK_CLOEXEC
- if (__have_sock_cloexec < 0)
-# endif
- __fcntl(LogFile, F_SETFD, FD_CLOEXEC);
-#endif
+ LogFile = __socket(AF_UNIX, LogType | SOCK_CLOEXEC, 0);
+ if (LogFile == -1)
+ return;
}
}
if (LogFile != -1 && !connected)
@@ -452,8 +425,7 @@ closelog (void)
/* setlogmask -- set the log mask level */
int
-setlogmask(pmask)
- int pmask;
+setlogmask (int pmask)
{
int omask;
diff --git a/misc/truncate.c b/misc/truncate.c
index 750f9553af..c79bec04af 100644
--- a/misc/truncate.c
+++ b/misc/truncate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -20,9 +20,7 @@
/* Truncate PATH to LENGTH bytes. */
int
-__truncate (path, length)
- const char *path;
- off_t length;
+__truncate (const char *path, off_t length)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/truncate64.c b/misc/truncate64.c
index d1bb4ade2e..c1e032aa3c 100644
--- a/misc/truncate64.c
+++ b/misc/truncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2016 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
@@ -21,9 +21,7 @@
/* Truncate PATH to LENGTH bytes. */
int
-truncate64 (path, length)
- const char *path;
- off64_t length;
+truncate64 (const char *path, off64_t length)
{
if ((off_t) length != length)
{
diff --git a/misc/tsearch.c b/misc/tsearch.c
index 869dc9bec7..ffb89ec0f8 100644
--- a/misc/tsearch.c
+++ b/misc/tsearch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>, 1997.
@@ -301,10 +301,7 @@ weak_alias (__tsearch, tsearch)
KEY is the key to be located, ROOTP is the address of tree root,
COMPAR the ordering function. */
void *
-__tfind (key, vrootp, compar)
- const void *key;
- void *const *vrootp;
- __compar_fn_t compar;
+__tfind (const void *key, void *const *vrootp, __compar_fn_t compar)
{
node *rootp = (node *) vrootp;
diff --git a/misc/tst-dirname.c b/misc/tst-dirname.c
index db08a8d40d..c6ae20d9c0 100644
--- a/misc/tst-dirname.c
+++ b/misc/tst-dirname.c
@@ -1,5 +1,5 @@
/* Test program for dirname function a la XPG.
- Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/misc/tst-efgcvt.c b/misc/tst-efgcvt.c
index 5083fec91e..b8a7ef20ad 100644
--- a/misc/tst-efgcvt.c
+++ b/misc/tst-efgcvt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2016 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
diff --git a/misc/tst-fdset.c b/misc/tst-fdset.c
index 077e0dbb8f..861c31607e 100644
--- a/misc/tst-fdset.c
+++ b/misc/tst-fdset.c
@@ -1,5 +1,5 @@
/* Test FD* macros.
- Copyright (C) 1997-2015 Free Software Foundation, Inc.
+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Robert Bihlmeyer <robbe@orcus.priv.at>.
diff --git a/misc/tst-mntent-blank-corrupt.c b/misc/tst-mntent-blank-corrupt.c
new file mode 100644
index 0000000000..9e33ea083a
--- /dev/null
+++ b/misc/tst-mntent-blank-corrupt.c
@@ -0,0 +1,45 @@
+/* Make sure blank lines does not cause memory corruption BZ #18887.
+
+ Copyright (C) 2009-2016 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/>. */
+
+#include <mntent.h>
+#include <stdio.h>
+#include <string.h>
+
+/* Make sure blank lines don't trigger memory corruption. This doesn't happen
+ for all targets though, so it's a best effort test BZ #18887. */
+static int
+do_test (void)
+{
+ FILE *fp;
+
+ fp = tmpfile ();
+ fputs ("\n \n/foo\\040dir /bar\\040dir auto bind \t \n", fp);
+ rewind (fp);
+
+ /* The corruption happens here ... */
+ getmntent (fp);
+ /* ... but trigers here. */
+ endmntent (fp);
+
+ /* If the test failed, we would crash, and not hit this point. */
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/misc/tst-mntent-blank-passno.c b/misc/tst-mntent-blank-passno.c
new file mode 100644
index 0000000000..1bc21faa64
--- /dev/null
+++ b/misc/tst-mntent-blank-passno.c
@@ -0,0 +1,53 @@
+/* Make sure trailing whitespace is handled properly BZ #17273.
+
+ Copyright (C) 2009-2016 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/>. */
+
+#include <mntent.h>
+#include <stdio.h>
+#include <string.h>
+
+/* Check entries to make sure trailing whitespace is ignored and we return the
+ correct passno value BZ #17273. */
+static int
+do_test (void)
+{
+ int result = 0;
+ FILE *fp;
+ struct mntent *mnt;
+
+ fp = tmpfile ();
+ fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp);
+ rewind (fp);
+
+ mnt = getmntent (fp);
+ if (strcmp (mnt->mnt_fsname, "/foo dir") != 0
+ || strcmp (mnt->mnt_dir, "/bar dir") != 0
+ || strcmp (mnt->mnt_type, "auto") != 0
+ || strcmp (mnt->mnt_opts, "bind") != 0
+ || mnt->mnt_freq != 0
+ || mnt->mnt_passno != 0)
+ {
+ puts ("Error while reading entry with trailing whitespaces");
+ result = 1;
+ }
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c
index 876c89f8ed..b6ad8afcc6 100644
--- a/misc/tst-mntent.c
+++ b/misc/tst-mntent.c
@@ -5,8 +5,8 @@
#include <string.h>
-int
-main (int argc, char *argv[])
+static int
+do_test (void)
{
int result = 0;
struct mntent mef;
@@ -73,27 +73,10 @@ main (int argc, char *argv[])
puts ("Error while reading written entry back in");
result = 1;
}
-
- /* Part III: Entry with whitespaces at the end of a line. */
- rewind (fp);
-
- fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp);
-
- rewind (fp);
-
- mnt = getmntent (fp);
-
- if (strcmp (mnt->mnt_fsname, "/foo dir") != 0
- || strcmp (mnt->mnt_dir, "/bar dir") != 0
- || strcmp (mnt->mnt_type, "auto") != 0
- || strcmp (mnt->mnt_opts, "bind") != 0
- || mnt->mnt_freq != 0
- || mnt->mnt_passno != 0)
- {
- puts ("Error while reading entry with trailing whitespaces");
- result = 1;
- }
}
return result;
}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/misc/tst-tsearch.c b/misc/tst-tsearch.c
index 70b6c339fc..01912460eb 100644
--- a/misc/tst-tsearch.c
+++ b/misc/tst-tsearch.c
@@ -1,5 +1,5 @@
/* Test program for tsearch et al.
- Copyright (C) 1997-2015 Free Software Foundation, Inc.
+ Copyright (C) 1997-2016 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
@@ -248,8 +248,8 @@ mangle_tree (enum order how, enum action what, void **root, int lag)
}
-int
-main (int argc, char **argv)
+static int
+do_test (void)
{
int total_error = 0;
static char state[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
@@ -350,3 +350,7 @@ main (int argc, char **argv)
return total_error;
}
+
+#define TIMEOUT 10
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/misc/ualarm.c b/misc/ualarm.c
index c6b097270f..510198a56a 100644
--- a/misc/ualarm.c
+++ b/misc/ualarm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -24,9 +24,7 @@
Returns the number of microseconds remaining before the alarm. */
useconds_t
-ualarm (value, interval)
- useconds_t value;
- useconds_t interval;
+ualarm (useconds_t value, useconds_t interval)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/usleep.c b/misc/usleep.c
index a28b77c22b..2e61362526 100644
--- a/misc/usleep.c
+++ b/misc/usleep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -20,8 +20,7 @@
/* Sleep USECONDS microseconds, or until a previously set timer goes off. */
int
-usleep (useconds)
- useconds_t useconds;
+usleep (useconds_t useconds)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/ustat.c b/misc/ustat.c
index 1e84062b50..c460ef183f 100644
--- a/misc/ustat.c
+++ b/misc/ustat.c
@@ -1,5 +1,5 @@
/* Return info on filesystem.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 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
@@ -21,9 +21,7 @@
#include <sys/ustat.h>
int
-ustat (dev, ust)
- dev_t dev;
- struct ustat * ust;
+ustat (dev_t dev, struct ustat *ust)
{
__set_errno (ENOSYS);
return -1;
diff --git a/misc/utimes.c b/misc/utimes.c
index 6b969e7b50..62acd2cb96 100644
--- a/misc/utimes.c
+++ b/misc/utimes.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -22,9 +22,7 @@
/* Change the access time of FILE to TVP[0] and
the modification time of FILE to TVP[1]. */
int
-__utimes (file, tvp)
- const char *file;
- const struct timeval tvp[2];
+__utimes (const char *file, const struct timeval tvp[2])
{
if (file == NULL)
{
diff --git a/misc/vhangup.c b/misc/vhangup.c
index 97825406c7..e0ed8ed9be 100644
--- a/misc/vhangup.c
+++ b/misc/vhangup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
diff --git a/misc/writev.c b/misc/writev.c
index 34e7841584..3531d617e8 100644
--- a/misc/writev.c
+++ b/misc/writev.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2016 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
@@ -25,10 +25,7 @@
Operates just like `write' (see <unistd.h>) except that the data
are taken from VECTOR instead of a contiguous buffer. */
ssize_t
-__writev (fd, vector, count)
- int fd;
- const struct iovec *vector;
- int count;
+__writev (int fd, const struct iovec *vector, int count)
{
__set_errno (ENOSYS);
return -1;