diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-04-21 23:47:39 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-04-21 23:47:39 +0000 |
commit | 882e83ccf31fca22178b290a6753a605bb52044c (patch) | |
tree | e2e6ec6ef7e162fd03a03e5c71bc96ce90d1c105 /lib/libc/gen | |
parent | 67d88b0a9910a68bb666b448d2dac29cb4d3d8c2 (diff) |
sync to netbsd 960418
Diffstat (limited to 'lib/libc/gen')
-rw-r--r-- | lib/libc/gen/Makefile.inc | 7 | ||||
-rw-r--r-- | lib/libc/gen/_err.c | 9 | ||||
-rw-r--r-- | lib/libc/gen/_errx.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/_verr.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/_verrx.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/_vwarn.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/_vwarnx.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/_warn.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/_warnx.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/err.c | 135 | ||||
-rw-r--r-- | lib/libc/gen/errx.c | 74 | ||||
-rw-r--r-- | lib/libc/gen/fstab.c | 14 | ||||
-rw-r--r-- | lib/libc/gen/gethostname.3 | 7 | ||||
-rw-r--r-- | lib/libc/gen/getttyent.3 | 6 | ||||
-rw-r--r-- | lib/libc/gen/setmode.c | 5 | ||||
-rw-r--r-- | lib/libc/gen/siginterrupt.c | 6 | ||||
-rw-r--r-- | lib/libc/gen/signal.3 | 11 | ||||
-rw-r--r-- | lib/libc/gen/sysctl.3 | 2 | ||||
-rw-r--r-- | lib/libc/gen/verr.c | 75 | ||||
-rw-r--r-- | lib/libc/gen/verrx.c | 68 | ||||
-rw-r--r-- | lib/libc/gen/vwarn.c | 72 | ||||
-rw-r--r-- | lib/libc/gen/vwarnx.c | 65 | ||||
-rw-r--r-- | lib/libc/gen/warn.c | 72 | ||||
-rw-r--r-- | lib/libc/gen/warnx.c | 72 |
24 files changed, 595 insertions, 161 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index d980d3e0746..bdbc4b2fb1d 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -1,11 +1,12 @@ -# $NetBSD: Makefile.inc,v 1.70 1995/04/25 00:06:17 jtc Exp $ +# $OpenBSD: Makefile.inc,v 1.2 1996/04/21 23:39:01 deraadt Exp $ +# $NetBSD: Makefile.inc,v 1.71 1996/04/15 23:44:53 jtc Exp $ # @(#)Makefile.inc 8.3 (Berkeley) 4/16/94 # gen sources .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/gen ${.CURDIR}/gen SRCS+= alarm.c assert.c clock.c closedir.c confstr.c ctermid.c \ - ctype_.c daemon.c devname.c disklabel.c err.c errlist.c \ + ctype_.c daemon.c devname.c disklabel.c err.c errx.c errlist.c \ errno.c exec.c fnmatch.c fstab.c ftok.c fts.c getbsize.c getcap.c \ getcwd.c getdomainname.c getgrent.c getgrouplist.c gethostname.c \ getloadavg.c getlogin.c getmntinfo.c getnetgrent.c getpagesize.c \ @@ -17,7 +18,7 @@ SRCS+= alarm.c assert.c clock.c closedir.c confstr.c ctermid.c \ sigsetops.c sleep.c sysconf.c sysctl.c syslog.c telldir.c \ time.c times.c timezone.c tolower_.c ttyname.c ttyslot.c toupper_.c \ ualarm.c uname.c unvis.c usleep.c utime.c valloc.c vis.c wait.c \ - wait3.c waitpid.c + wait3.c waitpid.c warn.c warnx.c vwarn.c vwarnx.c verr.c verrx.c # indirect reference stubs, to be removed soon. SRCS+= _err.c _errx.c _sys_errlist.c _sys_nerr.c _sys_siglist.c \ diff --git a/lib/libc/gen/_err.c b/lib/libc/gen/_err.c index 60f679dfa71..032ee4b1bfd 100644 --- a/lib/libc/gen/_err.c +++ b/lib/libc/gen/_err.c @@ -1,3 +1,5 @@ +/* $OpenBSD: _err.c,v 1.2 1996/04/21 23:39:04 deraadt Exp $ */ + /* * J.T. Conklin, December 12, 1994 * Public Domain @@ -10,13 +12,6 @@ __indr_reference(_err, err); #else #define _err err -#define _errx errx -#define _warn warn -#define _warnx warnx -#define _verr verr -#define _verrx verrx -#define _vwarn vwarn -#define _vwarnx vwarnx #define rcsid _rcsid #include "err.c" diff --git a/lib/libc/gen/_errx.c b/lib/libc/gen/_errx.c index 6b03fbaa60a..739ed17ec60 100644 --- a/lib/libc/gen/_errx.c +++ b/lib/libc/gen/_errx.c @@ -1,3 +1,5 @@ +/* $OpenBSD: _errx.c,v 1.2 1996/04/21 23:39:05 deraadt Exp $ */ + /* * J.T. Conklin, December 12, 1994 * Public Domain @@ -7,4 +9,10 @@ #ifdef __indr_reference __indr_reference(_errx, errx); +#else + +#define _errx errx +#define rcsid _rcsid +#include "errx.c" + #endif diff --git a/lib/libc/gen/_verr.c b/lib/libc/gen/_verr.c index b747c98c41c..3ff3d8a5fdc 100644 --- a/lib/libc/gen/_verr.c +++ b/lib/libc/gen/_verr.c @@ -1,3 +1,5 @@ +/* $OpenBSD: _verr.c,v 1.2 1996/04/21 23:39:07 deraadt Exp $ */ + /* * J.T. Conklin, December 12, 1994 * Public Domain @@ -7,4 +9,10 @@ #ifdef __indr_reference __indr_reference(_verr, verr); +#else + +#define _verr verr +#define rcsid _rcsid +#include "verr.c" + #endif diff --git a/lib/libc/gen/_verrx.c b/lib/libc/gen/_verrx.c index ff8342d512f..5d2acd4bdfc 100644 --- a/lib/libc/gen/_verrx.c +++ b/lib/libc/gen/_verrx.c @@ -1,3 +1,5 @@ +/* $OpenBSD: _verrx.c,v 1.2 1996/04/21 23:39:08 deraadt Exp $ */ + /* * J.T. Conklin, December 12, 1994 * Public Domain @@ -7,4 +9,10 @@ #ifdef __indr_reference __indr_reference(_verrx, verrx); +#else + +#define _verrx verrx +#define rcsid _rcsid +#include "verrx.c" + #endif diff --git a/lib/libc/gen/_vwarn.c b/lib/libc/gen/_vwarn.c index 11d4ff6a5fe..b8fcf397622 100644 --- a/lib/libc/gen/_vwarn.c +++ b/lib/libc/gen/_vwarn.c @@ -1,3 +1,5 @@ +/* $OpenBSD: _vwarn.c,v 1.2 1996/04/21 23:39:10 deraadt Exp $ */ + /* * J.T. Conklin, December 12, 1994 * Public Domain @@ -7,4 +9,10 @@ #ifdef __indr_reference __indr_reference(_vwarn, vwarn); +#else + +#define _vwarn vwarn +#define rcsid _rcsid +#include "vwarn.c" + #endif diff --git a/lib/libc/gen/_vwarnx.c b/lib/libc/gen/_vwarnx.c index 463ce58ce80..532a93b57c6 100644 --- a/lib/libc/gen/_vwarnx.c +++ b/lib/libc/gen/_vwarnx.c @@ -1,3 +1,5 @@ +/* $OpenBSD: _vwarnx.c,v 1.2 1996/04/21 23:39:12 deraadt Exp $ */ + /* * J.T. Conklin, December 12, 1994 * Public Domain @@ -7,4 +9,10 @@ #ifdef __indr_reference __indr_reference(_vwarnx, vwarnx); +#else + +#define _vwarnx vwarnx +#define rcsid _rcsid +#include "vwarnx.c" + #endif diff --git a/lib/libc/gen/_warn.c b/lib/libc/gen/_warn.c index 4e42eaf31bb..9776e82379d 100644 --- a/lib/libc/gen/_warn.c +++ b/lib/libc/gen/_warn.c @@ -1,3 +1,5 @@ +/* $OpenBSD: _warn.c,v 1.2 1996/04/21 23:39:14 deraadt Exp $ */ + /* * J.T. Conklin, December 12, 1994 * Public Domain @@ -7,4 +9,10 @@ #ifdef __indr_reference __indr_reference(_warn, warn); +#else + +#define _warn warn +#define rcsid _rcsid +#include "warn.c" + #endif diff --git a/lib/libc/gen/_warnx.c b/lib/libc/gen/_warnx.c index 74b9715dcba..007e41d573a 100644 --- a/lib/libc/gen/_warnx.c +++ b/lib/libc/gen/_warnx.c @@ -1,3 +1,5 @@ +/* $OpenBSD: _warnx.c,v 1.2 1996/04/21 23:39:15 deraadt Exp $ */ + /* * J.T. Conklin, December 12, 1994 * Public Domain @@ -7,4 +9,10 @@ #ifdef __indr_reference __indr_reference(_warnx, warnx); +#else + +#define _warnx warnx +#define rcsid _rcsid +#include "warnx.c" + #endif diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index bc825899183..094ea952a98 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -1,4 +1,5 @@ -/* $NetBSD: err.c,v 1.12 1995/02/25 17:19:26 cgd Exp $ */ +/* $OpenBSD: err.c,v 1.2 1996/04/21 23:39:17 deraadt Exp $ */ +/* $NetBSD: err.c,v 1.13 1996/04/15 23:45:29 jtc Exp $ */ /*- * Copyright (c) 1993 @@ -37,15 +38,11 @@ #if 0 static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$NetBSD: err.c,v 1.12 1995/02/25 17:19:26 cgd Exp $"; +static char rcsid[] = "$NetBSD: err.c,v 1.13 1996/04/15 23:45:29 jtc Exp $"; #endif #endif /* LIBC_SCCS and not lint */ #include <err.h> -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #ifdef __STDC__ #include <stdarg.h> @@ -53,26 +50,6 @@ static char rcsid[] = "$NetBSD: err.c,v 1.12 1995/02/25 17:19:26 cgd Exp $"; #include <varargs.h> #endif -extern char *__progname; /* Program name, from crt0. */ - -__dead void -_verr(eval, fmt, ap) - int eval; - const char *fmt; - va_list ap; -{ - int sverrno; - - sverrno = errno; - (void)fprintf(stderr, "%s: ", __progname); - if (fmt != NULL) { - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, ": "); - } - (void)fprintf(stderr, "%s\n", strerror(sverrno)); - exit(eval); -} - __dead void #ifdef __STDC__ _err(int eval, const char *fmt, ...) @@ -95,109 +72,3 @@ _err(va_alist) _verr(eval, fmt, ap); va_end(ap); } - -__dead void -_verrx(eval, fmt, ap) - int eval; - const char *fmt; - va_list ap; -{ - (void)fprintf(stderr, "%s: ", __progname); - if (fmt != NULL) - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, "\n"); - exit(eval); -} - -__dead void -#if __STDC__ -_errx(int eval, const char *fmt, ...) -#else -_errx(va_alist) - va_dcl -#endif -{ - va_list ap; -#if __STDC__ - va_start(ap, fmt); -#else - int eval; - const char *fmt; - - va_start(ap); - eval = va_arg(ap, int); - fmt = va_arg(ap, const char *); -#endif - _verrx(eval, fmt, ap); - va_end(ap); -} - - -void -_vwarn(fmt, ap) - const char *fmt; - va_list ap; -{ - int sverrno; - - sverrno = errno; - (void)fprintf(stderr, "%s: ", __progname); - if (fmt != NULL) { - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, ": "); - } - (void)fprintf(stderr, "%s\n", strerror(sverrno)); -} - -void -#if __STDC__ -_warn(const char *fmt, ...) -#else -_warn(va_alist) - va_dcl -#endif -{ - va_list ap; -#if __STDC__ - va_start(ap, fmt); -#else - const char *fmt; - - va_start(ap); - fmt = va_arg(ap, const char *); -#endif - _vwarn(fmt, ap); - va_end(ap); -} - -void -_vwarnx(fmt, ap) - const char *fmt; - va_list ap; -{ - (void)fprintf(stderr, "%s: ", __progname); - if (fmt != NULL) - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, "\n"); -} - -void -#ifdef __STDC__ -_warnx(const char *fmt, ...) -#else -_warnx(va_alist) - va_dcl -#endif -{ - va_list ap; -#ifdef __STDC__ - va_start(ap, fmt); -#else - const char *fmt; - - va_start(ap); - fmt = va_arg(ap, const char *); -#endif - _vwarnx(fmt, ap); - va_end(ap); -} diff --git a/lib/libc/gen/errx.c b/lib/libc/gen/errx.c new file mode 100644 index 00000000000..7f9dd6a38c3 --- /dev/null +++ b/lib/libc/gen/errx.c @@ -0,0 +1,74 @@ +/* $OpenBSD: errx.c,v 1.1 1996/04/21 23:39:18 deraadt Exp $ */ +/* $NetBSD: errx.c,v 1.1 1996/04/15 23:45:32 jtc Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; +#else +static char rcsid[] = "$NetBSD: errx.c,v 1.1 1996/04/15 23:45:32 jtc Exp $"; +#endif +#endif /* LIBC_SCCS and not lint */ + +#include <err.h> + +#ifdef __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +__dead void +#if __STDC__ +_errx(int eval, const char *fmt, ...) +#else +_errx(va_alist) + va_dcl +#endif +{ + va_list ap; +#if __STDC__ + va_start(ap, fmt); +#else + int eval; + const char *fmt; + + va_start(ap); + eval = va_arg(ap, int); + fmt = va_arg(ap, const char *); +#endif + _verrx(eval, fmt, ap); + va_end(ap); +} diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c index cc131dd54d7..bc1e3646d0f 100644 --- a/lib/libc/gen/fstab.c +++ b/lib/libc/gen/fstab.c @@ -1,4 +1,5 @@ -/* $NetBSD: fstab.c,v 1.7 1995/02/27 04:34:44 cgd Exp $ */ +/* $OpenBSD: fstab.c,v 1.2 1996/04/21 23:39:19 deraadt Exp $ */ +/* $NetBSD: fstab.c,v 1.8 1996/04/03 19:48:56 jtc Exp $ */ /* * Copyright (c) 1980, 1988, 1993 @@ -37,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)fstab.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$NetBSD: fstab.c,v 1.7 1995/02/27 04:34:44 cgd Exp $"; +static char rcsid[] = "$NetBSD: fstab.c,v 1.8 1996/04/03 19:48:56 jtc Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -53,10 +54,10 @@ static char rcsid[] = "$NetBSD: fstab.c,v 1.7 1995/02/27 04:34:44 cgd Exp $"; static FILE *_fs_fp; static struct fstab _fs_fstab; -static error __P((int)); -static fstabscan __P((void)); +static void error __P((int)); +static int fstabscan __P((void)); -static +static int fstabscan() { register char *cp; @@ -176,6 +177,7 @@ getfsfile(name) return((struct fstab *)NULL); } +int setfsent() { if (_fs_fp) { @@ -197,7 +199,7 @@ endfsent() } } -static +static void error(err) int err; { diff --git a/lib/libc/gen/gethostname.3 b/lib/libc/gen/gethostname.3 index ff8717eb84a..63f4dd0e443 100644 --- a/lib/libc/gen/gethostname.3 +++ b/lib/libc/gen/gethostname.3 @@ -1,4 +1,5 @@ -.\" $NetBSD: gethostname.3,v 1.3 1996/02/11 16:15:40 neil Exp $ +.\" $OpenBSD: gethostname.3,v 1.3 1996/04/21 23:39:21 deraadt Exp $ +.\" $NetBSD: gethostname.3,v 1.4 1996/04/08 20:56:38 jtc Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -84,8 +85,8 @@ invalid address. The caller tried to set the hostname and was not the super-user. .El .Sh SEE ALSO -.Xr sysctl 3 -.Xr gethostid 3 +.Xr sysctl 3 , +.Xr gethostid 3 , .Xr sysctl 8 .Sh BUGS Host names are limited to diff --git a/lib/libc/gen/getttyent.3 b/lib/libc/gen/getttyent.3 index 94adb769aff..39c2e04f6e4 100644 --- a/lib/libc/gen/getttyent.3 +++ b/lib/libc/gen/getttyent.3 @@ -1,4 +1,5 @@ -.\" $NetBSD: getttyent.3,v 1.6 1995/02/27 04:13:16 cgd Exp $ +.\" $OpenBSD: getttyent.3,v 1.2 1996/04/21 23:39:22 deraadt Exp $ +.\" $NetBSD: getttyent.3,v 1.7 1996/03/17 19:36:53 christos Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -104,6 +105,9 @@ Allow users with a uid of 0 to login on this terminal. .It Dv TTY_LOCAL If the terminal port's driver supports it, cause the line to be treated as ``local.'' +.It Dv TTY_MDMBUF +If the terminal port's driver supports it, use +DTR/DCD hardware flow control on the line by default. .It Dv TTY_RTSCTS If the terminal port's driver supports it, use full-duplex RTS/CTS hardware flow control on the line diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c index 0d6eb4eeb4d..37c111a21c9 100644 --- a/lib/libc/gen/setmode.c +++ b/lib/libc/gen/setmode.c @@ -1,4 +1,5 @@ -/* $NetBSD: setmode.c,v 1.12 1995/03/23 19:51:13 jtc Exp $ */ +/* $OpenBSD: setmode.c,v 1.3 1996/04/21 23:39:25 deraadt Exp $ */ +/* $NetBSD: setmode.c,v 1.13 1996/04/03 19:49:01 jtc Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -40,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)setmode.c 8.2 (Berkeley) 3/25/94"; #else -static char rcsid[] = "$NetBSD: setmode.c,v 1.12 1995/03/23 19:51:13 jtc Exp $"; +static char rcsid[] = "$NetBSD: setmode.c,v 1.13 1996/04/03 19:49:01 jtc Exp $"; #endif #endif /* LIBC_SCCS and not lint */ diff --git a/lib/libc/gen/siginterrupt.c b/lib/libc/gen/siginterrupt.c index a8b0c25e730..cc075f49859 100644 --- a/lib/libc/gen/siginterrupt.c +++ b/lib/libc/gen/siginterrupt.c @@ -1,4 +1,5 @@ -/* $NetBSD: siginterrupt.c,v 1.6 1995/03/04 01:56:00 cgd Exp $ */ +/* $OpenBSD: siginterrupt.c,v 1.2 1996/04/21 23:39:27 deraadt Exp $ */ +/* $NetBSD: siginterrupt.c,v 1.7 1996/04/03 19:49:03 jtc Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)siginterrupt.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$NetBSD: siginterrupt.c,v 1.6 1995/03/04 01:56:00 cgd Exp $"; +static char rcsid[] = "$NetBSD: siginterrupt.c,v 1.7 1996/04/03 19:49:03 jtc Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -47,6 +48,7 @@ static char rcsid[] = "$NetBSD: siginterrupt.c,v 1.6 1995/03/04 01:56:00 cgd Exp * Set signal state to prevent restart of system calls * after an instance of the indicated signal. */ +int siginterrupt(sig, flag) int sig, flag; { diff --git a/lib/libc/gen/signal.3 b/lib/libc/gen/signal.3 index dd9c82b255b..260d4945760 100644 --- a/lib/libc/gen/signal.3 +++ b/lib/libc/gen/signal.3 @@ -1,4 +1,5 @@ -.\" $NetBSD: signal.3,v 1.5 1995/02/27 05:51:12 cgd Exp $ +.\" $OpenBSD: signal.3,v 1.2 1996/04/21 23:39:28 deraadt Exp $ +.\" $NetBSD: signal.3,v 1.6 1996/03/26 02:05:55 jtc Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -42,11 +43,11 @@ .Sh SYNOPSIS .Fd #include <signal.h> .Ft void -.Fn *signal sig func\*(lp\*(rp -.Ft void -.\" can not do this with .Fn yet +.\" can not do this with just .Fn yet .br -\*(lp\|\*(fN*func\*(rp\*(lp\|\*(rp\fR +.Po +.Fn *signal "int sig" "void (*func)()" +.Pc Ns \*(lp\*(rp .Sh DESCRIPTION This .Fn signal diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index 1c28f23dbe1..07973bc965f 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -1,3 +1,4 @@ +.\" $OpenBSD: sysctl.3,v 1.2 1996/04/21 23:39:30 deraadt Exp $ .\" $NetBSD: sysctl.3,v 1.7 1995/09/30 07:03:54 thorpej Exp $ .\" .\" Copyright (c) 1993 @@ -40,6 +41,7 @@ .Nm sysctl .Nd get or set system information .Sh SYNOPSIS +.Fd #include <sys/param.h> .Fd #include <sys/sysctl.h> .Ft int .Fn sysctl "int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "void *newp" "size_t newlen" diff --git a/lib/libc/gen/verr.c b/lib/libc/gen/verr.c new file mode 100644 index 00000000000..fba24377e51 --- /dev/null +++ b/lib/libc/gen/verr.c @@ -0,0 +1,75 @@ +/* $OpenBSD: verr.c,v 1.1 1996/04/21 23:39:32 deraadt Exp $ */ +/* $NetBSD: verr.c,v 1.1 1996/04/15 23:45:35 jtc Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; +#else +static char rcsid[] = "$NetBSD: verr.c,v 1.1 1996/04/15 23:45:35 jtc Exp $"; +#endif +#endif /* LIBC_SCCS and not lint */ + +#include <err.h> +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +extern char *__progname; /* Program name, from crt0. */ + +__dead void +_verr(eval, fmt, ap) + int eval; + const char *fmt; + va_list ap; +{ + int sverrno; + + sverrno = errno; + (void)fprintf(stderr, "%s: ", __progname); + if (fmt != NULL) { + (void)vfprintf(stderr, fmt, ap); + (void)fprintf(stderr, ": "); + } + (void)fprintf(stderr, "%s\n", strerror(sverrno)); + exit(eval); +} diff --git a/lib/libc/gen/verrx.c b/lib/libc/gen/verrx.c new file mode 100644 index 00000000000..23a4e4e417a --- /dev/null +++ b/lib/libc/gen/verrx.c @@ -0,0 +1,68 @@ +/* $OpenBSD: verrx.c,v 1.1 1996/04/21 23:39:33 deraadt Exp $ */ +/* $NetBSD: verrx.c,v 1.1 1996/04/15 23:45:36 jtc Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; +#else +static char rcsid[] = "$NetBSD: verrx.c,v 1.1 1996/04/15 23:45:36 jtc Exp $"; +#endif +#endif /* LIBC_SCCS and not lint */ + +#include <err.h> +#include <stdio.h> +#include <stdlib.h> + +#ifdef __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +extern char *__progname; /* Program name, from crt0. */ + +__dead void +_verrx(eval, fmt, ap) + int eval; + const char *fmt; + va_list ap; +{ + (void)fprintf(stderr, "%s: ", __progname); + if (fmt != NULL) + (void)vfprintf(stderr, fmt, ap); + (void)fprintf(stderr, "\n"); + exit(eval); +} diff --git a/lib/libc/gen/vwarn.c b/lib/libc/gen/vwarn.c new file mode 100644 index 00000000000..7c4c8a2a78d --- /dev/null +++ b/lib/libc/gen/vwarn.c @@ -0,0 +1,72 @@ +/* $OpenBSD: vwarn.c,v 1.1 1996/04/21 23:39:34 deraadt Exp $ */ +/* $NetBSD: vwarn.c,v 1.1 1996/04/15 23:45:38 jtc Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; +#else +static char rcsid[] = "$NetBSD: vwarn.c,v 1.1 1996/04/15 23:45:38 jtc Exp $"; +#endif +#endif /* LIBC_SCCS and not lint */ + +#include <err.h> +#include <errno.h> +#include <stdio.h> +#include <string.h> + +#ifdef __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +extern char *__progname; /* Program name, from crt0. */ + +void +_vwarn(fmt, ap) + const char *fmt; + va_list ap; +{ + int sverrno; + + sverrno = errno; + (void)fprintf(stderr, "%s: ", __progname); + if (fmt != NULL) { + (void)vfprintf(stderr, fmt, ap); + (void)fprintf(stderr, ": "); + } + (void)fprintf(stderr, "%s\n", strerror(sverrno)); +} diff --git a/lib/libc/gen/vwarnx.c b/lib/libc/gen/vwarnx.c new file mode 100644 index 00000000000..b1d16a688d8 --- /dev/null +++ b/lib/libc/gen/vwarnx.c @@ -0,0 +1,65 @@ +/* $OpenBSD: vwarnx.c,v 1.1 1996/04/21 23:39:35 deraadt Exp $ */ +/* $NetBSD: vwarnx.c,v 1.1 1996/04/15 23:45:40 jtc Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; +#else +static char rcsid[] = "$NetBSD: vwarnx.c,v 1.1 1996/04/15 23:45:40 jtc Exp $"; +#endif +#endif /* LIBC_SCCS and not lint */ + +#include <err.h> +#include <stdio.h> + +#ifdef __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +extern char *__progname; /* Program name, from crt0. */ + +void +_vwarnx(fmt, ap) + const char *fmt; + va_list ap; +{ + (void)fprintf(stderr, "%s: ", __progname); + if (fmt != NULL) + (void)vfprintf(stderr, fmt, ap); + (void)fprintf(stderr, "\n"); +} diff --git a/lib/libc/gen/warn.c b/lib/libc/gen/warn.c new file mode 100644 index 00000000000..4f0fa6f693e --- /dev/null +++ b/lib/libc/gen/warn.c @@ -0,0 +1,72 @@ +/* $OpenBSD: warn.c,v 1.1 1996/04/21 23:39:37 deraadt Exp $ */ +/* $NetBSD: warn.c,v 1.1 1996/04/15 23:45:42 jtc Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; +#else +static char rcsid[] = "$NetBSD: warn.c,v 1.1 1996/04/15 23:45:42 jtc Exp $"; +#endif +#endif /* LIBC_SCCS and not lint */ + +#include <err.h> + +#ifdef __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +void +#ifdef __STDC__ +_warn(const char *fmt, ...) +#else +_warn(va_alist) + va_dcl +#endif +{ + va_list ap; +#if __STDC__ + va_start(ap, fmt); +#else + const char *fmt; + + va_start(ap); + fmt = va_arg(ap, const char *); +#endif + _vwarn(fmt, ap); + va_end(ap); +} diff --git a/lib/libc/gen/warnx.c b/lib/libc/gen/warnx.c new file mode 100644 index 00000000000..9b1e8d5a940 --- /dev/null +++ b/lib/libc/gen/warnx.c @@ -0,0 +1,72 @@ +/* $OpenBSD: warnx.c,v 1.1 1996/04/21 23:39:38 deraadt Exp $ */ +/* $NetBSD: warnx.c,v 1.1 1996/04/15 23:45:44 jtc Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93"; +#else +static char rcsid[] = "$NetBSD: warnx.c,v 1.1 1996/04/15 23:45:44 jtc Exp $"; +#endif +#endif /* LIBC_SCCS and not lint */ + +#include <err.h> + +#ifdef __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +void +#ifdef __STDC__ +_warnx(const char *fmt, ...) +#else +_warnx(va_alist) + va_dcl +#endif +{ + va_list ap; +#ifdef __STDC__ + va_start(ap, fmt); +#else + const char *fmt; + + va_start(ap); + fmt = va_arg(ap, const char *); +#endif + _vwarnx(fmt, ap); + va_end(ap); +} |