Permalink
Browse files

OpenBSD 3.3

  • Loading branch information...
1 parent 02dfb0a commit 202eadb4d7b5d8a4f08c1953dcf49158cca10784 itojun committed May 1, 2003
Showing with 1,093 additions and 698 deletions.
  1. +4 −4 openbsd/bin/ls/ls.1
  2. +3 −3 openbsd/include/Makefile
  3. +116 −39 openbsd/include/ctype.h
  4. +2 −2 openbsd/include/dirent.h
  5. +85 −0 openbsd/include/getopt.h
  6. +2 −2 openbsd/include/locale.h
  7. +5 −1 openbsd/include/md4.h
  8. +5 −1 openbsd/include/md5.h
  9. +5 −1 openbsd/include/rmd160.h
  10. +3 −3 openbsd/include/rpc/clnt.h
  11. +3 −3 openbsd/include/rpc/xdr.h
  12. +20 −16 openbsd/include/sha1.h
  13. +2 −2 openbsd/include/stddef.h
  14. +3 −2 openbsd/include/stdio.h
  15. +9 −2 openbsd/include/stdlib.h
  16. +3 −2 openbsd/include/string.h
  17. +2 −2 openbsd/include/time.h
  18. +11 −4 openbsd/include/unistd.h
  19. +16 −12 openbsd/sbin/ifconfig/ifconfig.8
  20. +11 −11 openbsd/sbin/ifconfig/ifconfig.c
  21. +3 −1 openbsd/sbin/ping/ping.8
  22. +7 −5 openbsd/sbin/route/route.8
  23. +48 −86 openbsd/sbin/route/route.c
  24. +47 −24 openbsd/sbin/route/show.c
  25. +69 −26 openbsd/sbin/sysctl/sysctl.8
  26. +99 −4 openbsd/sbin/sysctl/sysctl.c
  27. +2 −2 openbsd/usr.bin/fstat/fstat.1
  28. +12 −27 openbsd/usr.bin/netstat/atalk.c
  29. +7 −13 openbsd/usr.bin/netstat/if.c
  30. +28 −62 openbsd/usr.bin/netstat/inet.c
  31. +33 −41 openbsd/usr.bin/netstat/inet6.c
  32. +20 −28 openbsd/usr.bin/netstat/ipx.c
  33. +19 −49 openbsd/usr.bin/netstat/iso.c
  34. +22 −28 openbsd/usr.bin/netstat/main.c
  35. +6 −7 openbsd/usr.bin/netstat/mbuf.c
  36. +4 −7 openbsd/usr.bin/netstat/mroute.c
  37. +11 −18 openbsd/usr.bin/netstat/mroute6.c
  38. +15 −25 openbsd/usr.bin/netstat/ns.c
  39. +28 −50 openbsd/usr.bin/netstat/route.c
  40. +4 −7 openbsd/usr.bin/netstat/unix.c
  41. +25 −26 openbsd/usr.bin/systat/iostat.c
  42. +2 −2 openbsd/usr.bin/systat/systat.1
  43. +11 −11 openbsd/usr.bin/systat/vmstat.c
  44. +162 −25 openbsd/usr.bin/vmstat/dkstats.c
  45. +2 −1 openbsd/usr.bin/vmstat/dkstats.h
  46. +6 −7 openbsd/usr.bin/vmstat/vmstat.8
  47. +91 −4 openbsd/usr.bin/vmstat/vmstat.c
View
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ls.1,v 1.33 2002/02/11 18:43:51 mpech Exp $
+.\" $OpenBSD: ls.1,v 1.34 2003/03/12 20:12:35 deraadt Exp $
.\" $NetBSD: ls.1,v 1.14 1995/12/05 02:44:01 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
@@ -394,18 +394,18 @@ The
.Nm
utility exits 0 on success or >0 if an error occurred.
.Sh EXAMPLES
-.Cm $ ls -l
+.Li $ ls -l
.Pp
List the contents of the current working directory in long format.
.Pp
-.Cm $ ls -lioF
+.Li $ ls -lioF
.Pp
In addition to listing the contents of the current working directory in
long format, show inode numbers, file flags (see
.Xr chflags 1 ) ,
and suffix each filename with a symbol representing its file type.
.Pp
-.Cm $ ls -lt /var/log
+.Li $ ls -lt /var/log
.Pp
List the files in
.Pa /var/log ,
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.113 2002/09/03 18:59:55 markus Exp $
+# $OpenBSD: Makefile,v 1.115 2003/01/20 18:12:52 marc Exp $
# $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $
# @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
@@ -10,7 +10,7 @@
FILES= a.out.h ar.h assert.h bitstring.h blf.h bm.h bsd_auth.h cast.h \
cpio.h ctype.h curses.h db.h dbm.h des.h dirent.h disktab.h \
- dlfcn.h elf_abi.h err.h fnmatch.h fstab.h fts.h glob.h grp.h \
+ dlfcn.h elf_abi.h err.h fnmatch.h fstab.h fts.h getopt.h glob.h grp.h \
ifaddrs.h inttypes.h iso646.h kvm.h langinfo.h libgen.h limits.h \
locale.h login_cap.h malloc.h math.h md4.h md5.h memory.h mpool.h \
ndbm.h netdb.h netgroup.h nlist.h nl_types.h ohash.h olf_abi.h \
@@ -34,7 +34,7 @@ LDIRS= crypto ddb dev isofs miscfs net netatalk netccitt netinet altq \
netinet6 netipx netiso netnatm netns nfs scsi sys ufs uvm xfs
# Directories with an includes target
-RDIRS= ../lib/libc_r ../lib/libcom_err ../lib/libcompat ../lib/libcurses \
+RDIRS= ../lib/libpthread ../lib/libcom_err ../lib/libcompat ../lib/libcurses \
../lib/libcurses++ ../lib/libform ../lib/libssl ../lib/libmenu \
../lib/libocurses ../lib/libossaudio ../lib/libpanel ../lib/librpcsvc \
../lib/libskey ../lib/libsectok ../lib/libedit ../lib/libpcap \
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctype.h,v 1.4 2002/02/16 21:27:17 millert Exp $ */
+/* $OpenBSD: ctype.h,v 1.12 2002/12/30 21:36:05 millert Exp $ */
/* $NetBSD: ctype.h,v 1.14 1994/10/26 00:55:47 cgd Exp $ */
/*
@@ -58,52 +58,129 @@ extern const char *_ctype_;
extern const short *_tolower_tab_;
extern const short *_toupper_tab_;
+#ifdef _ANSI_LIBRARY
__BEGIN_DECLS
-extern int isalnum(int);
-extern int isalpha(int);
-extern int iscntrl(int);
-extern int isdigit(int);
-extern int isgraph(int);
-extern int islower(int);
-extern int isprint(int);
-extern int ispunct(int);
-extern int isspace(int);
-extern int isupper(int);
-extern int isxdigit(int);
-extern int tolower(int);
-extern int toupper(int);
+int isalnum(int);
+int isalpha(int);
+int iscntrl(int);
+int isdigit(int);
+int isgraph(int);
+int islower(int);
+int isprint(int);
+int ispunct(int);
+int isspace(int);
+int isupper(int);
+int isxdigit(int);
+int tolower(int);
+int toupper(int);
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-extern int isblank(int);
-extern int isascii(int);
-extern int toascii(int);
-extern int _tolower(int);
-extern int _toupper(int);
+int isblank(int);
+int isascii(int);
+int toascii(int);
+int _tolower(int);
+int _toupper(int);
#endif
__END_DECLS
-#define isdigit(c) ((_ctype_ + 1)[(unsigned char)(c)] & _N)
-#define islower(c) ((_ctype_ + 1)[(unsigned char)(c)] & _L)
-#define isspace(c) ((_ctype_ + 1)[(unsigned char)(c)] & _S)
-#define ispunct(c) ((_ctype_ + 1)[(unsigned char)(c)] & _P)
-#define isupper(c) ((_ctype_ + 1)[(unsigned char)(c)] & _U)
-#define isalpha(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_U|_L))
-#define isxdigit(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_N|_X))
-#define isalnum(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_U|_L|_N))
-#define isprint(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_P|_U|_L|_N|_B))
-#define isgraph(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_P|_U|_L|_N))
-#define iscntrl(c) ((_ctype_ + 1)[(unsigned char)(c)] & _C)
-#define tolower(c) ((_tolower_tab_ + 1)[(unsigned char)(c)])
-#define toupper(c) ((_toupper_tab_ + 1)[(unsigned char)(c)])
+#else /* !_ANSI_LIBRARY */
+
+static __inline int isalnum(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_U|_L|_N)));
+}
+
+static __inline int isalpha(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_U|_L)));
+}
+
+static __inline int iscntrl(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _C));
+}
+
+static __inline int isdigit(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _N));
+}
+
+static __inline int isgraph(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_P|_U|_L|_N)));
+}
+
+static __inline int islower(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _L));
+}
+
+static __inline int isprint(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_P|_U|_L|_N|_B)));
+}
+
+static __inline int ispunct(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _P));
+}
+
+static __inline int isspace(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _S));
+}
+
+static __inline int isupper(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _U));
+}
+
+static __inline int isxdigit(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_N|_X)));
+}
+
+static __inline int tolower(int c)
+{
+ if ((unsigned int)c > 0177)
+ return (c);
+ return ((_tolower_tab_ + 1)[c]);
+}
+
+static __inline int toupper(int c)
+{
+ if ((unsigned int)c > 0177)
+ return (c);
+ return ((_toupper_tab_ + 1)[c]);
+}
#if !defined(_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
-#if notyet
-#define isblank(c) ((_ctype_ + 1)[(unsigned char)(c)] & _B)
-#endif
-#define isascii(c) ((unsigned char)(c) <= 0177)
-#define toascii(c) ((c) & 0177)
-#define _tolower(c) ((c) - 'A' + 'a')
-#define _toupper(c) ((c) - 'a' + 'A')
+static __inline int isblank(int c)
+{
+ return (c == ' ' || c == '\t');
+}
+
+static __inline int isascii(int c)
+{
+ return ((unsigned int)c <= 0177);
+}
+
+static __inline int toascii(int c)
+{
+ return (c & 0177);
+}
+
+static __inline int _tolower(int c)
+{
+ return (c - 'A' + 'a');
+}
+
+static __inline int _toupper(int c)
+{
+ return (c - 'a' + 'A');
+}
#endif
+#endif /* !_ANSI_LIBRARY */
+
#endif /* !_CTYPE_H_ */
@@ -1,4 +1,4 @@
-/* $OpenBSD: dirent.h,v 1.8 2002/02/17 19:42:21 millert Exp $ */
+/* $OpenBSD: dirent.h,v 1.9 2002/10/25 21:55:28 millert Exp $ */
/* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */
/*-
@@ -85,7 +85,7 @@ typedef struct _dirdesc {
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0
+#define NULL 0L
#endif
#endif
@@ -0,0 +1,85 @@
+/* $OpenBSD: getopt.h,v 1.1 2002/12/03 20:24:29 millert Exp $ */
+/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * 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 NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _GETOPT_H_
+#define _GETOPT_H_
+
+#include <sys/cdefs.h>
+
+/*
+ * GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
+ */
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+struct option {
+ /* name of long option */
+ const char *name;
+ /*
+ * one of no_argument, required_argument, and optional_argument:
+ * whether option takes an argument
+ */
+ int has_arg;
+ /* if not NULL, set *flag to val when option found */
+ int *flag;
+ /* if flag not NULL, value to set *flag to; else return value */
+ int val;
+};
+
+__BEGIN_DECLS
+int getopt_long(int, char * const *, const char *,
+ const struct option *, int *);
+int getopt_long_only(int, char * const *, const char *,
+ const struct option *, int *);
+#ifndef _GETOPT_DEFINED_
+#define _GETOPT_DEFINED_
+int getopt(int, char * const *, const char *);
+int getsubopt(char **, char * const *, char **);
+
+extern char *optarg; /* getopt(3) external variables */
+extern int opterr;
+extern int optind;
+extern int optopt;
+extern int optreset;
+extern char *suboptarg; /* getsubopt(3) external variable */
+#endif
+__END_DECLS
+
+#endif /* !_GETOPT_H_ */
@@ -1,4 +1,4 @@
-/* $OpenBSD: locale.h,v 1.4 2002/02/16 21:27:17 millert Exp $ */
+/* $OpenBSD: locale.h,v 1.5 2002/10/25 21:55:28 millert Exp $ */
/* $NetBSD: locale.h,v 1.6 1994/10/26 00:56:02 cgd Exp $ */
/*
@@ -64,7 +64,7 @@ struct lconv {
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0
+#define NULL 0L
#endif
#endif
@@ -1,5 +1,5 @@
/* MD4.H - header file for MD4C.C
- * $OpenBSD: md4.h,v 1.6 2002/02/16 21:27:17 millert Exp $
+ * $OpenBSD: md4.h,v 1.7 2002/12/23 04:33:31 millert Exp $
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
@@ -33,12 +33,16 @@ typedef struct MD4Context {
unsigned char buffer[64]; /* input buffer */
} MD4_CTX;
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
void MD4Init(MD4_CTX *);
void MD4Update(MD4_CTX *, const unsigned char *, size_t);
void MD4Final(unsigned char [16], MD4_CTX *);
void MD4Transform(u_int32_t [4], const unsigned char [64]);
char * MD4End(MD4_CTX *, char *);
char * MD4File(char *, char *);
char * MD4Data(const unsigned char *, size_t, char *);
+__END_DECLS
#endif /* _MD4_H_ */
@@ -1,5 +1,5 @@
/* MD5.H - header file for MD5C.C
- * $OpenBSD: md5.h,v 1.6 2002/02/16 21:27:17 millert Exp $
+ * $OpenBSD: md5.h,v 1.7 2002/12/23 04:33:31 millert Exp $
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
@@ -34,12 +34,16 @@ typedef struct MD5Context {
unsigned char buffer[64]; /* input buffer */
} MD5_CTX;
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
void MD5Init(MD5_CTX *);
void MD5Update(MD5_CTX *, const unsigned char *, size_t);
void MD5Final(unsigned char [16], MD5_CTX *);
void MD5Transform(u_int32_t [4], const unsigned char [64]);
char * MD5End(MD5_CTX *, char *);
char * MD5File(char *, char *);
char * MD5Data(const unsigned char *, size_t, char *);
+__END_DECLS
#endif /* _MD5_H_ */
Oops, something went wrong. Retry.

0 comments on commit 202eadb

Please sign in to comment.