diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-09-12 14:56:51 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-09-12 14:56:51 +0000 |
commit | e64b6c4739e4ab6efdeffd0ae4b67bd74666daca (patch) | |
tree | 997b15537fb0b72142ac451ca44523049dfd2ea7 | |
parent | 708d74d49280694cfab20a17028e578ec48fe52f (diff) |
Wrap <unistd.h> so that internal calls go direct and they're all weak symbols
Delete unused 'fd' argument from internal function oldttyname()
-rw-r--r-- | lib/libc/crypt/crypt.c | 4 | ||||
-rw-r--r-- | lib/libc/crypt/cryptutil.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/exec.c | 5 | ||||
-rw-r--r-- | lib/libc/gen/getdomainname.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/getgrouplist.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/gethostname.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/getlogin.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/getpagesize.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/initgroups.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/isatty.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/sysconf.c | 3 | ||||
-rw-r--r-- | lib/libc/gen/ttyname.c | 11 | ||||
-rw-r--r-- | lib/libc/hidden/unistd.h | 76 | ||||
-rw-r--r-- | lib/libc/net/rcmd.c | 1 | ||||
-rw-r--r-- | lib/libc/net/rcmdsh.c | 3 | ||||
-rw-r--r-- | lib/libc/net/rresvport.c | 3 | ||||
-rw-r--r-- | lib/libc/net/ruserok.c | 1 | ||||
-rw-r--r-- | lib/libc/stdio/mktemp.c | 4 |
18 files changed, 117 insertions, 20 deletions
diff --git a/lib/libc/crypt/crypt.c b/lib/libc/crypt/crypt.c index 95e69bbe998..40d5503544f 100644 --- a/lib/libc/crypt/crypt.c +++ b/lib/libc/crypt/crypt.c @@ -1,7 +1,8 @@ -/* $OpenBSD: crypt.c,v 1.30 2015/07/18 01:18:50 jeremy Exp $ */ +/* $OpenBSD: crypt.c,v 1.31 2015/09/12 14:56:50 guenther Exp $ */ #include <errno.h> #include <pwd.h> +#include <unistd.h> char * crypt(const char *key, const char *setting) @@ -18,3 +19,4 @@ crypt(const char *key, const char *setting) errno = EINVAL; return (NULL); } +DEF_WEAK(crypt); diff --git a/lib/libc/crypt/cryptutil.c b/lib/libc/crypt/cryptutil.c index d750933ffb4..20d68b3fd30 100644 --- a/lib/libc/crypt/cryptutil.c +++ b/lib/libc/crypt/cryptutil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptutil.c,v 1.10 2015/07/23 22:19:03 tedu Exp $ */ +/* $OpenBSD: cryptutil.c,v 1.11 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> * @@ -50,6 +50,7 @@ fail: errno = EACCES; return -1; } +DEF_WEAK(crypt_checkpass); int crypt_newhash(const char *pass, const char *pref, char *hash, size_t hashlen) @@ -95,3 +96,4 @@ crypt_newhash(const char *pass, const char *pref, char *hash, size_t hashlen) err: return rv; } +DEF_WEAK(crypt_newhash); diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 1e2f7d97dd2..73297ae9a79 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.c,v 1.21 2013/09/30 12:02:33 millert Exp $ */ +/* $OpenBSD: exec.c,v 1.22 2015/09/12 14:56:50 guenther Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -67,6 +67,7 @@ execl(const char *name, const char *arg, ...) va_end(ap); return (execve(name, argv, environ)); } +DEF_WEAK(execl); int execle(const char *name, const char *arg, ...) @@ -242,10 +243,12 @@ retry: (void)execve(bp, argv, envp); done: return (-1); } +DEF_WEAK(execvpe); int execvp(const char *name, char *const *argv) { return execvpe(name, argv, environ); } +DEF_WEAK(execvp); diff --git a/lib/libc/gen/getdomainname.c b/lib/libc/gen/getdomainname.c index 83aaf9449b3..b0d8dcf0ed0 100644 --- a/lib/libc/gen/getdomainname.c +++ b/lib/libc/gen/getdomainname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getdomainname.c,v 1.8 2015/01/14 23:03:50 deraadt Exp $ */ +/* $OpenBSD: getdomainname.c,v 1.9 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -45,3 +45,4 @@ getdomainname(char *name, size_t namelen) return (-1); return (0); } +DEF_WEAK(getdomainname); diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c index 79f6da75e8b..7a904a2fd9a 100644 --- a/lib/libc/gen/getgrouplist.c +++ b/lib/libc/gen/getgrouplist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getgrouplist.c,v 1.25 2015/06/03 02:24:36 millert Exp $ */ +/* $OpenBSD: getgrouplist.c,v 1.26 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 2008 Ingo Schwarze <schwarze@usta.de> * Copyright (c) 1991, 1993 @@ -239,3 +239,4 @@ out: *grpcnt = ngroups; return (ret); } +DEF_WEAK(getgrouplist); diff --git a/lib/libc/gen/gethostname.c b/lib/libc/gen/gethostname.c index 4ae3439683e..aa1e4ce6cf3 100644 --- a/lib/libc/gen/gethostname.c +++ b/lib/libc/gen/gethostname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gethostname.c,v 1.8 2015/01/14 23:03:50 deraadt Exp $ */ +/* $OpenBSD: gethostname.c,v 1.9 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -45,3 +45,4 @@ gethostname(char *name, size_t namelen) return (-1); return (0); } +DEF_WEAK(gethostname); diff --git a/lib/libc/gen/getlogin.c b/lib/libc/gen/getlogin.c index 6ec91052a19..ff2837ae99d 100644 --- a/lib/libc/gen/getlogin.c +++ b/lib/libc/gen/getlogin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getlogin.c,v 1.12 2013/09/30 12:02:33 millert Exp $ */ +/* $OpenBSD: getlogin.c,v 1.13 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -83,6 +83,7 @@ getlogin_r(char *name, size_t namelen) _THREAD_PRIVATE_MUTEX_UNLOCK(logname); return 0; } +DEF_WEAK(getlogin_r); int setlogin(const char *name) diff --git a/lib/libc/gen/getpagesize.c b/lib/libc/gen/getpagesize.c index 37d02554b97..3c81d64209e 100644 --- a/lib/libc/gen/getpagesize.c +++ b/lib/libc/gen/getpagesize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getpagesize.c,v 1.7 2015/01/14 23:03:50 deraadt Exp $ */ +/* $OpenBSD: getpagesize.c,v 1.8 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -49,3 +49,4 @@ getpagesize(void) } return (pagsz); } +DEF_WEAK(getpagesize); diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c index 9d7727a9c2b..b8c32ad653e 100644 --- a/lib/libc/gen/initgroups.c +++ b/lib/libc/gen/initgroups.c @@ -1,4 +1,4 @@ -/* $OpenBSD: initgroups.c,v 1.9 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: initgroups.c,v 1.10 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -45,3 +45,4 @@ initgroups(const char *uname, gid_t agroup) return (-1); return (0); } +DEF_WEAK(initgroups); diff --git a/lib/libc/gen/isatty.c b/lib/libc/gen/isatty.c index c0b543698db..ba45a987738 100644 --- a/lib/libc/gen/isatty.c +++ b/lib/libc/gen/isatty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isatty.c,v 1.10 2015/05/17 01:56:02 deraadt Exp $ */ +/* $OpenBSD: isatty.c,v 1.11 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -29,9 +29,11 @@ */ #include <fcntl.h> +#include <unistd.h> int isatty(int fd) { return fcntl(fd, F_ISATTY) != -1; } +DEF_WEAK(isatty); diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index bdf99a17711..3f39418f026 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysconf.c,v 1.22 2015/01/16 18:18:58 millert Exp $ */ +/* $OpenBSD: sysconf.c,v 1.23 2015/09/12 14:56:50 guenther Exp $ */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -468,3 +468,4 @@ sysconf(int name) } return (sysctl(mib, namelen, &value, &len, NULL, 0) == -1 ? -1 : value); } +DEF_WEAK(sysconf); diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c index e8a27d64479..f54ddf09d30 100644 --- a/lib/libc/gen/ttyname.c +++ b/lib/libc/gen/ttyname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttyname.c,v 1.14 2015/06/19 23:54:15 jca Exp $ */ +/* $OpenBSD: ttyname.c,v 1.15 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -42,7 +42,7 @@ #include "thread_private.h" static char buf[TTY_NAME_MAX]; -static int oldttyname(int, struct stat *, char *, size_t); +static int oldttyname(struct stat *, char *, size_t); char * ttyname(int fd) @@ -62,6 +62,7 @@ ttyname(int fd) return bufp; } +DEF_WEAK(ttyname); int ttyname_r(int fd, char *buf, size_t len) @@ -106,12 +107,12 @@ ttyname_r(int fd, char *buf, size_t len) } (void)(db->close)(db); } - return (oldttyname(fd, &sb, buf, len)); + return (oldttyname(&sb, buf, len)); } +DEF_WEAK(ttyname_r); -/* ARGSUSED */ static int -oldttyname(int fd, struct stat *sb, char *buf, size_t len) +oldttyname(struct stat *sb, char *buf, size_t len) { struct dirent *dirp; DIR *dp; diff --git a/lib/libc/hidden/unistd.h b/lib/libc/hidden/unistd.h index d79f401a345..66c0b0ae335 100644 --- a/lib/libc/hidden/unistd.h +++ b/lib/libc/hidden/unistd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: unistd.h,v 1.2 2015/09/11 15:38:33 guenther Exp $ */ +/* $OpenBSD: unistd.h,v 1.3 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> * @@ -20,29 +20,60 @@ #include_next <unistd.h> +PROTO_NORMAL(__tfork_thread); PROTO_NORMAL(_exit); PROTO_NORMAL(access); PROTO_NORMAL(acct); +PROTO_DEPRECATED(alarm); PROTO_DEPRECATED(brk); PROTO_NORMAL(chdir); PROTO_NORMAL(chown); PROTO_NORMAL(chroot); +/*PROTO_CANCEL(close);*/ +/*PROTO_CANCEL(closefrom);*/ +PROTO_DEPRECATED(confstr); +PROTO_NORMAL(crypt); +PROTO_NORMAL(crypt_checkpass); +PROTO_NORMAL(crypt_newhash); PROTO_NORMAL(dup); PROTO_NORMAL(dup2); PROTO_NORMAL(dup3); +PROTO_DEPRECATED(endusershell); +PROTO_NORMAL(execl); +PROTO_DEPRECATED(execle); +PROTO_DEPRECATED(execlp); +PROTO_DEPRECATED(execv); PROTO_NORMAL(execve); +PROTO_NORMAL(execvp); +PROTO_NORMAL(execvpe); PROTO_NORMAL(faccessat); PROTO_NORMAL(fchdir); PROTO_NORMAL(fchown); PROTO_NORMAL(fchownat); +/*PROTO_CANCEL(fdatasync);*/ +PROTO_DEPRECATED(fflagstostr); +/*PROTO_WRAP(fork);*/ PROTO_NORMAL(fpathconf); +/*PROTO_CANCEL(fsync);*/ PROTO_NORMAL(ftruncate); +/*PROTO_BARE(getcwd);*/ +PROTO_NORMAL(getdomainname); PROTO_NORMAL(getdtablecount); +PROTO_DEPRECATED(getdtablesize); PROTO_NORMAL(getegid); PROTO_NORMAL(getentropy); PROTO_NORMAL(geteuid); PROTO_NORMAL(getgid); +PROTO_NORMAL(getgrouplist); PROTO_NORMAL(getgroups); +PROTO_DEPRECATED(gethostid); +PROTO_NORMAL(gethostname); +/*PROTO_BARE(getlogin);*/ +PROTO_NORMAL(getlogin_r); +PROTO_DEPRECATED(getmode); +PROTO_DEPRECATED(getopt); +PROTO_NORMAL(getpagesize); +PROTO_DEPRECATED(getpass); PROTO_NORMAL(getpgid); PROTO_NORMAL(getpgrp); PROTO_NORMAL(getpid); @@ -52,40 +83,83 @@ PROTO_NORMAL(getresuid); PROTO_NORMAL(getsid); PROTO_NORMAL(getthrid); PROTO_NORMAL(getuid); +PROTO_DEPRECATED(getusershell); +PROTO_DEPRECATED(getwd); +PROTO_NORMAL(initgroups); +PROTO_DEPRECATED(iruserok); +PROTO_NORMAL(iruserok_sa); +PROTO_NORMAL(isatty); PROTO_NORMAL(issetugid); PROTO_NORMAL(lchown); PROTO_NORMAL(link); PROTO_NORMAL(linkat); +/*PROTO_CANCEL(lockf);*/ PROTO_NORMAL(lseek); +PROTO_NORMAL(mkdtemp); +PROTO_NORMAL(mkstemp); +/*PROTO_DEPRECATED(mkstemps); use declaration from stdlib.h */ +/*PROTO_DEPRECATED(mktemp); use declaration from stdlib.h */ PROTO_NORMAL(nfssvc); +PROTO_DEPRECATED(nice); PROTO_NORMAL(pathconf); +/*PROTO_CANCEL(pause);*/ PROTO_NORMAL(pipe); PROTO_NORMAL(pipe2); +/*PROTO_CANCEL(pread);*/ PROTO_NORMAL(profil); +/*PROTO_CANCEL(pwrite);*/ PROTO_NORMAL(quotactl); +PROTO_DEPRECATED(rcmd); +PROTO_NORMAL(rcmd_af); +PROTO_NORMAL(rcmdsh); +/*PROTO_CANCEL(read);*/ PROTO_NORMAL(readlink); PROTO_NORMAL(readlinkat); PROTO_NORMAL(reboot); PROTO_NORMAL(revoke); PROTO_NORMAL(rmdir); +PROTO_DEPRECATED(rresvport); +PROTO_NORMAL(rresvport_af); +PROTO_DEPRECATED(ruserok); PROTO_DEPRECATED(sbrk); +/*PROTO_CANCEL(select);*/ +PROTO_DEPRECATED(setdomainname); PROTO_NORMAL(setegid); PROTO_NORMAL(seteuid); PROTO_NORMAL(setgid); PROTO_NORMAL(setgroups); +PROTO_DEPRECATED(sethostid); +PROTO_DEPRECATED(sethostname); +/*PROTO_WRAP(setlogin);*/ +PROTO_DEPRECATED(setmode); PROTO_NORMAL(setpgid); +PROTO_DEPRECATED(setpgrp); PROTO_NORMAL(setregid); PROTO_NORMAL(setresgid); PROTO_NORMAL(setresuid); PROTO_NORMAL(setreuid); PROTO_NORMAL(setsid); PROTO_NORMAL(setuid); +PROTO_DEPRECATED(setusershell); +/*PROTO_CANCEL(sleep);*/ +PROTO_DEPRECATED(strtofflags); +PROTO_DEPRECATED(swab); PROTO_NORMAL(swapctl); PROTO_NORMAL(symlink); PROTO_NORMAL(symlinkat); PROTO_NORMAL(sync); +PROTO_NORMAL(syscall); +PROTO_NORMAL(sysconf); +PROTO_DEPRECATED(tcgetpgrp); +PROTO_DEPRECATED(tcsetpgrp); PROTO_NORMAL(truncate); +PROTO_NORMAL(ttyname); +PROTO_NORMAL(ttyname_r); +PROTO_DEPRECATED(ualarm); PROTO_NORMAL(unlink); PROTO_NORMAL(unlinkat); +PROTO_DEPRECATED(usleep); +/*PROTO_WRAP(vfork);*/ +/*PROTO_CANCEL(write);*/ #endif /* !_LIBC_UNISTD_H_ */ diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 600565a2359..bf686036493 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -292,4 +292,5 @@ bad: sigprocmask(SIG_SETMASK, &oldmask, NULL); return (-1); } +DEF_WEAK(rcmd_af); diff --git a/lib/libc/net/rcmdsh.c b/lib/libc/net/rcmdsh.c index ab86475c84d..ad3f79ecc56 100644 --- a/lib/libc/net/rcmdsh.c +++ b/lib/libc/net/rcmdsh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcmdsh.c,v 1.14 2015/03/23 22:29:32 halex Exp $ */ +/* $OpenBSD: rcmdsh.c,v 1.15 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 2001, MagniComp @@ -181,3 +181,4 @@ rcmdsh(char **ahost, int rport, const char *locuser, const char *remuser, } /* NOTREACHED */ } +DEF_WEAK(rcmdsh); diff --git a/lib/libc/net/rresvport.c b/lib/libc/net/rresvport.c index 2ecbc0a67d6..6b45000f7b7 100644 --- a/lib/libc/net/rresvport.c +++ b/lib/libc/net/rresvport.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rresvport.c,v 1.10 2015/01/16 16:48:51 deraadt Exp $ */ +/* $OpenBSD: rresvport.c,v 1.11 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 1995, 1996, 1998 Theo de Raadt. All rights reserved. * Copyright (c) 1983, 1993, 1994 @@ -104,3 +104,4 @@ rresvport_af(int *alport, int af) *alport = ntohs(*portp); return (s); } +DEF_WEAK(rresvport_af); diff --git a/lib/libc/net/ruserok.c b/lib/libc/net/ruserok.c index eed76d97db2..4e83b78bf66 100644 --- a/lib/libc/net/ruserok.c +++ b/lib/libc/net/ruserok.c @@ -174,6 +174,7 @@ again: } return (-1); } +DEF_WEAK(iruserok_sa); /* * XXX diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index 43b38dd8b6d..abb7c544d55 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mktemp.c,v 1.36 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: mktemp.c,v 1.37 2015/09/12 14:56:50 guenther Exp $ */ /* * Copyright (c) 1996-1998, 2008 Theo de Raadt * Copyright (c) 1997, 2008-2009 Todd C. Miller @@ -138,6 +138,7 @@ mkstemp(char *path) { return(mktemp_internal(path, 0, MKTEMP_FILE, 0)); } +DEF_WEAK(mkstemp); int mkostemp(char *path, int flags) @@ -159,3 +160,4 @@ mkdtemp(char *path) error = mktemp_internal(path, 0, MKTEMP_DIR, 0); return(error ? NULL : path); } +DEF_WEAK(mkdtemp); |