diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/Makefile | 3 | ||||
-rw-r--r-- | misc/error.c | 2 | ||||
-rw-r--r-- | misc/fstab.c | 2 | ||||
-rw-r--r-- | misc/ftruncate.c | 2 | ||||
-rw-r--r-- | misc/getauxval.c | 5 | ||||
-rw-r--r-- | misc/getclktck.c | 2 | ||||
-rw-r--r-- | misc/getdtsz.c | 2 | ||||
-rw-r--r-- | misc/gethostid.c | 2 | ||||
-rw-r--r-- | misc/getpagesize.c | 2 | ||||
-rw-r--r-- | misc/getsysstats.c | 8 | ||||
-rw-r--r-- | misc/getttyent.c | 20 | ||||
-rw-r--r-- | misc/getusershell.c | 12 | ||||
-rw-r--r-- | misc/hsearch.c | 2 | ||||
-rw-r--r-- | misc/swapon.c | 3 | ||||
-rw-r--r-- | misc/sync.c | 2 | ||||
-rw-r--r-- | misc/sys/auxv.h | 4 | ||||
-rw-r--r-- | misc/syslog.c | 6 | ||||
-rw-r--r-- | misc/ttyslot.c | 8 | ||||
-rw-r--r-- | misc/vhangup.c | 2 |
19 files changed, 46 insertions, 43 deletions
diff --git a/misc/Makefile b/misc/Makefile index 4b52669dde..3d6760b42b 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -72,7 +72,7 @@ generated := tst-error1.mtrace tst-error1-mem include ../Makeconfig aux := init-misc -install-lib := libbsd-compat.a libg.a +install-lib := libg.a gpl2lgpl := error.c error.h tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \ @@ -104,7 +104,6 @@ tests-static += tst-sbrk-static include ../Rules -$(objpfx)libbsd-compat.a: $(dep-dummy-lib); $(make-dummy-lib) $(objpfx)libg.a: $(dep-dummy-lib); $(make-dummy-lib) ifeq ($(build-shared),yes) diff --git a/misc/error.c b/misc/error.c index c8e62cf9b4..408a1ab25e 100644 --- a/misc/error.c +++ b/misc/error.c @@ -165,7 +165,7 @@ error_tail (int status, int errnum, const char *message, va_list args) if (res != len) break; - if (__builtin_expect (len >= SIZE_MAX / 2, 0)) + if (__builtin_expect (len >= SIZE_MAX / sizeof (wchar_t) / 2, 0)) { /* This really should not happen if everything is fine. */ res = (size_t) -1; diff --git a/misc/fstab.c b/misc/fstab.c index 0e2d86bd05..6172bcba3e 100644 --- a/misc/fstab.c +++ b/misc/fstab.c @@ -95,7 +95,7 @@ getfsfile (name) void -endfsent () +endfsent (void) { struct fstab_state *state; diff --git a/misc/ftruncate.c b/misc/ftruncate.c index 80830f82d6..7b38b17372 100644 --- a/misc/ftruncate.c +++ b/misc/ftruncate.c @@ -30,5 +30,5 @@ __ftruncate (fd, length) } weak_alias (__ftruncate, ftruncate) - + stub_warning (ftruncate) diff --git a/misc/getauxval.c b/misc/getauxval.c index 4321e3718a..dd4c8ecab3 100644 --- a/misc/getauxval.c +++ b/misc/getauxval.c @@ -16,6 +16,7 @@ <http://www.gnu.org/licenses/>. */ #include <sys/auxv.h> +#include <errno.h> #include <ldsodefs.h> @@ -26,10 +27,14 @@ __getauxval (unsigned long int type) if (type == AT_HWCAP) return GLRO(dl_hwcap); + else if (type == AT_HWCAP2) + return GLRO(dl_hwcap2); for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++) if (p->a_type == type) return p->a_un.a_val; + + __set_errno (ENOENT); return 0; } diff --git a/misc/getclktck.c b/misc/getclktck.c index 8975ea5726..ce90baa971 100644 --- a/misc/getclktck.c +++ b/misc/getclktck.c @@ -19,7 +19,7 @@ /* Return frequency of times(). */ int -__getclktck () +__getclktck (void) { #ifdef CLK_TCK return CLK_TCK; diff --git a/misc/getdtsz.c b/misc/getdtsz.c index 3aa9eeffd9..25cf14abe2 100644 --- a/misc/getdtsz.c +++ b/misc/getdtsz.c @@ -21,7 +21,7 @@ /* Return the maximum number of file descriptors the current process could possibly have. */ int -__getdtablesize () +__getdtablesize (void) { __set_errno (ENOSYS); return -1; diff --git a/misc/gethostid.c b/misc/gethostid.c index 44636f5857..ce8fd2c579 100644 --- a/misc/gethostid.c +++ b/misc/gethostid.c @@ -20,7 +20,7 @@ /* Return the current machine's Internet number. */ long int -gethostid () +gethostid (void) { __set_errno (ENOSYS); return -1L; diff --git a/misc/getpagesize.c b/misc/getpagesize.c index 93035a7213..43e00a899c 100644 --- a/misc/getpagesize.c +++ b/misc/getpagesize.c @@ -20,7 +20,7 @@ /* Return the system page size. */ int -__getpagesize () +__getpagesize (void) { __set_errno (ENOSYS); return 0; diff --git a/misc/getsysstats.c b/misc/getsysstats.c index 83b07cafec..d6f9df59d2 100644 --- a/misc/getsysstats.c +++ b/misc/getsysstats.c @@ -21,7 +21,7 @@ #include <sys/sysinfo.h> int -__get_nprocs_conf () +__get_nprocs_conf (void) { /* We don't know how to determine the number. Simply return always 1. */ return 1; @@ -33,7 +33,7 @@ link_warning (get_nprocs_conf, "warning: get_nprocs_conf will always return 1") int -__get_nprocs () +__get_nprocs (void) { /* We don't know how to determine the number. Simply return always 1. */ return 1; @@ -44,7 +44,7 @@ link_warning (get_nprocs, "warning: get_nprocs will always return 1") long int -__get_phys_pages () +__get_phys_pages (void) { /* We have no general way to determine this value. */ __set_errno (ENOSYS); @@ -56,7 +56,7 @@ stub_warning (get_phys_pages) long int -__get_avphys_pages () +__get_avphys_pages (void) { /* We have no general way to determine this value. */ __set_errno (ENOSYS); diff --git a/misc/getttyent.c b/misc/getttyent.c index b1e6376fb6..864f65f523 100644 --- a/misc/getttyent.c +++ b/misc/getttyent.c @@ -47,7 +47,7 @@ struct ttyent * getttynam(tty) const char *tty; { - register struct ttyent *t; + struct ttyent *t; setttyent(); while ((t = getttyent())) @@ -61,11 +61,11 @@ static char *skip (char *) __THROW internal_function; static char *value (char *) __THROW internal_function; struct ttyent * -getttyent() +getttyent (void) { static struct ttyent tty; - register int c; - register char *p; + int c; + char *p; #define MAXLINELENGTH 100 static char line[MAXLINELENGTH]; @@ -142,10 +142,10 @@ libc_hidden_def (getttyent) static char * internal_function skip(p) - register char *p; + char *p; { - register char *t; - register int c, q; + char *t; + int c, q; for (q = 0, t = p; (c = *p) != '\0'; p++) { if (c == '"') { @@ -177,14 +177,14 @@ skip(p) static char * internal_function value(p) - register char *p; + char *p; { return ((p = index(p, '=')) ? ++p : NULL); } int -setttyent() +setttyent (void) { if (tf) { @@ -200,7 +200,7 @@ setttyent() libc_hidden_def (setttyent) int -endttyent() +endttyent (void) { int rval; diff --git a/misc/getusershell.c b/misc/getusershell.c index 2e8d97e65c..fc2c43b771 100644 --- a/misc/getusershell.c +++ b/misc/getusershell.c @@ -62,7 +62,7 @@ static char **initshells (void) __THROW; * Get a list of shells from _PATH_SHELLS, if it exists. */ char * -getusershell() +getusershell (void) { char *ret; @@ -75,7 +75,7 @@ getusershell() } void -endusershell() +endusershell (void) { free(shells); @@ -86,17 +86,17 @@ endusershell() } void -setusershell() +setusershell (void) { curshell = initshells(); } static char ** -initshells() +initshells (void) { - register char **sp, *cp; - register FILE *fp; + char **sp, *cp; + FILE *fp; struct stat64 statb; size_t flen; diff --git a/misc/hsearch.c b/misc/hsearch.c index 96684c3080..58b5d393f4 100644 --- a/misc/hsearch.c +++ b/misc/hsearch.c @@ -45,7 +45,7 @@ hcreate (nel) void -__hdestroy () +__hdestroy (void) { hdestroy_r (&htab); } diff --git a/misc/swapon.c b/misc/swapon.c index 61933b8bb5..0e587d473f 100644 --- a/misc/swapon.c +++ b/misc/swapon.c @@ -22,8 +22,7 @@ /* Make the block special device PATH available to the system for swapping. This call is restricted to the super-user. */ int -swapon (path) - const char *path; +swapon (const char *path, int flags) { __set_errno (ENOSYS); return -1; diff --git a/misc/sync.c b/misc/sync.c index 1b663422b5..0b18e72531 100644 --- a/misc/sync.c +++ b/misc/sync.c @@ -20,7 +20,7 @@ /* Make all changes done to all files actually appear on disk. */ void -sync () +sync (void) { __set_errno (ENOSYS); } diff --git a/misc/sys/auxv.h b/misc/sys/auxv.h index a69250bd52..7aec3a04b8 100644 --- a/misc/sys/auxv.h +++ b/misc/sys/auxv.h @@ -27,9 +27,9 @@ __BEGIN_DECLS /* Return the value associated with an Elf*_auxv_t type from the auxv list passed to the program on startup. If TYPE was not present in the auxv - list, returns zero. */ + list, returns zero and sets errno to ENOENT. */ extern unsigned long int getauxval (unsigned long int __type) - __THROW __attribute_const__; + __THROW; __END_DECLS diff --git a/misc/syslog.c b/misc/syslog.c index 748361fc8c..70daa9e1f3 100644 --- a/misc/syslog.c +++ b/misc/syslog.c @@ -229,7 +229,7 @@ __vsyslog_chk(int pri, int flag, const char *fmt, va_list ap) /* Output to stderr if requested. */ if (LogStat & LOG_PERROR) { struct iovec iov[2]; - register struct iovec *v = iov; + struct iovec *v = iov; v->iov_base = buf + msgoff; v->iov_len = bufsize - msgoff; @@ -425,7 +425,7 @@ sigpipe_handler (int signo) #endif static void -closelog_internal() +closelog_internal (void) { if (!connected) return; @@ -436,7 +436,7 @@ closelog_internal() } void -closelog () +closelog (void) { /* Protect against multiple users and cancellation. */ __libc_cleanup_push (cancel_handler, NULL); diff --git a/misc/ttyslot.c b/misc/ttyslot.c index 5872f23fd0..9c69589dae 100644 --- a/misc/ttyslot.c +++ b/misc/ttyslot.c @@ -38,11 +38,11 @@ static char sccsid[] = "@(#)ttyslot.c 8.1 (Berkeley) 6/4/93"; #include <unistd.h> int -ttyslot() +ttyslot (void) { - register struct ttyent *ttyp; - register int slot; - register char *p; + struct ttyent *ttyp; + int slot; + char *p; int cnt; size_t buflen = __sysconf (_SC_TTY_NAME_MAX) + 1; char *name; diff --git a/misc/vhangup.c b/misc/vhangup.c index a8571f7c56..afee526f39 100644 --- a/misc/vhangup.c +++ b/misc/vhangup.c @@ -22,7 +22,7 @@ with the control terminal, and then send a SIGHUP signal to the process group of the control terminal. */ int -vhangup () +vhangup (void) { __set_errno (ENOSYS); return -1; |