summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-02-27 04:12:15 +0000
committercgd <cgd@NetBSD.org>1995-02-27 04:12:15 +0000
commitb585e843cabe5bfebee1c5e85e05e270b8aeea12 (patch)
tree5d8b840620699242e290c86ba7a93e81b8391c64 /lib/libc
parent72c46b1cdce84887f0b9e7b62a60de953f7127c3 (diff)
update from Lite, with local changes. fix Ids, etc.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/getcwd.311
-rw-r--r--lib/libc/gen/getcwd.c31
-rw-r--r--lib/libc/gen/getdiskbyname.311
-rw-r--r--lib/libc/gen/getdomainname.35
-rw-r--r--lib/libc/gen/getdomainname.c9
-rw-r--r--lib/libc/gen/getfsent.311
-rw-r--r--lib/libc/gen/getgrent.311
-rw-r--r--lib/libc/gen/getgrent.c13
-rw-r--r--lib/libc/gen/gethostname.32
-rw-r--r--lib/libc/gen/gethostname.c6
-rw-r--r--lib/libc/gen/getlogin.c13
-rw-r--r--lib/libc/gen/getmntinfo.317
-rw-r--r--lib/libc/gen/getmntinfo.c14
-rw-r--r--lib/libc/gen/getpagesize.32
-rw-r--r--lib/libc/gen/getpass.311
-rw-r--r--lib/libc/gen/getpass.c20
-rw-r--r--lib/libc/gen/getpwent.313
-rw-r--r--lib/libc/gen/getpwent.c13
-rw-r--r--lib/libc/gen/getsubopt.35
-rw-r--r--lib/libc/gen/getsubopt.c9
-rw-r--r--lib/libc/gen/getttyent.311
-rw-r--r--lib/libc/gen/getttyent.c13
-rw-r--r--lib/libc/gen/getusershell.311
-rw-r--r--lib/libc/gen/getusershell.c51
-rw-r--r--lib/libc/gen/glob.340
-rw-r--r--lib/libc/gen/glob.c9
26 files changed, 220 insertions, 142 deletions
diff --git a/lib/libc/gen/getcwd.3 b/lib/libc/gen/getcwd.3
index 41311112b04..e2f369c5175 100644
--- a/lib/libc/gen/getcwd.3
+++ b/lib/libc/gen/getcwd.3
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: getcwd.3,v 1.5 1995/02/27 04:12:15 cgd Exp $
+.\"
+.\" Copyright (c) 1991, 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
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getcwd.3 6.4 (Berkeley) 4/19/91
-.\" $Id: getcwd.3,v 1.4 1993/11/29 21:41:03 jtc Exp $
+.\" @(#)getcwd.3 8.2 (Berkeley) 12/11/93
.\"
-.Dd April 19, 1991
+.Dd December 11, 1993
.Dt GETCWD 3
.Os BSD 4.2
.Sh NAME
diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c
index 95ea273b6f3..ecd519aa6d1 100644
--- a/lib/libc/gen/getcwd.c
+++ b/lib/libc/gen/getcwd.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getcwd.c,v 1.4 1995/02/27 04:12:20 cgd Exp $ */
+
/*
- * Copyright (c) 1989, 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1991, 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
@@ -32,12 +34,16 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getcwd.c 5.11 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id: getcwd.c,v 1.3 1993/08/26 00:44:36 jtc Exp $";
+#if 0
+static char sccsid[] = "@(#)getcwd.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: getcwd.c,v 1.4 1995/02/27 04:12:20 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
#include <sys/stat.h>
+
#include <errno.h>
#include <dirent.h>
#include <stdio.h>
@@ -76,12 +82,12 @@ getcwd(pt, size)
ptsize = 0;
if (!size) {
errno = EINVAL;
- return((char *)NULL);
+ return (NULL);
}
ept = pt + size;
} else {
- if (!(pt = (char *)malloc(ptsize = 1024 - 4)))
- return((char *)NULL);
+ if ((pt = malloc(ptsize = 1024 - 4)) == NULL)
+ return (NULL);
ept = pt + ptsize;
}
bpt = ept - 1;
@@ -92,7 +98,7 @@ getcwd(pt, size)
* Should always be enough (it's 340 levels). If it's not, allocate
* as necessary. Special * case the first stat, it's ".", not "..".
*/
- if (!(up = (char *)malloc(upsize = 1024 - 4)))
+ if ((up = malloc(upsize = 1024 - 4)) == NULL)
goto err;
eup = up + MAXPATHLEN;
bup = up;
@@ -126,7 +132,7 @@ getcwd(pt, size)
*/
(void)bcopy(bpt, pt, ept - bpt);
free(up);
- return(pt);
+ return (pt);
}
/*
@@ -135,8 +141,9 @@ getcwd(pt, size)
* possible component name, plus a trailing NULL.
*/
if (bup + 3 + MAXNAMLEN + 1 >= eup) {
- if (!(up = (char *)realloc(up, upsize *= 2)))
+ if ((up = realloc(up, upsize *= 2)) == NULL)
goto err;
+ bup = up;
eup = up + upsize;
}
*bup++ = '.';
@@ -195,7 +202,7 @@ getcwd(pt, size)
}
off = bpt - pt;
len = ept - bpt;
- if (!(pt = (char *)realloc(pt, ptsize *= 2)))
+ if ((pt = realloc(pt, ptsize *= 2)) == NULL)
goto err;
bpt = pt + off;
ept = pt + ptsize;
@@ -225,5 +232,5 @@ err:
if (ptsize)
free(pt);
free(up);
- return((char *)NULL);
+ return (NULL);
}
diff --git a/lib/libc/gen/getdiskbyname.3 b/lib/libc/gen/getdiskbyname.3
index 07360f5c8d5..b008289c34d 100644
--- a/lib/libc/gen/getdiskbyname.3
+++ b/lib/libc/gen/getdiskbyname.3
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1983, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: getdiskbyname.3,v 1.3 1995/02/27 04:12:24 cgd Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 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
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getdiskbyname.3 6.6 (Berkeley) 4/19/91
-.\" $Id: getdiskbyname.3,v 1.2 1993/07/30 08:36:24 mycroft Exp $
+.\" @(#)getdiskbyname.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd April 19, 1991
+.Dd June 4, 1993
.Dt GETDISKBYNAME 3
.Os BSD 4.2
.Sh NAME
diff --git a/lib/libc/gen/getdomainname.3 b/lib/libc/gen/getdomainname.3
index 21a00ab7c33..0f33c45ff4b 100644
--- a/lib/libc/gen/getdomainname.3
+++ b/lib/libc/gen/getdomainname.3
@@ -1,3 +1,5 @@
+.\" $NetBSD: getdomainname.3,v 1.2 1995/02/27 04:12:27 cgd Exp $
+.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -29,8 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)gethostname.3 8.1 (Berkeley) 6/4/93
-.\" $Id: getdomainname.3,v 1.1 1994/05/07 03:09:19 cgd Exp $
+.\" @(#)gethostname.3 8.1 (Berkeley) 6/4/93
.\"
.Dd May 6, 1994
.Dt GETDOMAINNAME 3
diff --git a/lib/libc/gen/getdomainname.c b/lib/libc/gen/getdomainname.c
index 308f8392ade..0322c0ea121 100644
--- a/lib/libc/gen/getdomainname.c
+++ b/lib/libc/gen/getdomainname.c
@@ -1,3 +1,5 @@
+/* $NetBSD: getdomainname.c,v 1.2 1995/02/27 04:12:30 cgd Exp $ */
+
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,8 +34,11 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/* from: static char sccsid[] = "@(#)gethostname.c 8.1 (Berkeley) 6/4/93"; */
-static char *rcsid = "$Id: getdomainname.c,v 1.1 1994/05/07 03:09:22 cgd Exp $";
+#if 0
+static char sccsid[] = "@(#)gethostname.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: getdomainname.c,v 1.2 1995/02/27 04:12:30 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
diff --git a/lib/libc/gen/getfsent.3 b/lib/libc/gen/getfsent.3
index fd984d44d30..b3eb2550812 100644
--- a/lib/libc/gen/getfsent.3
+++ b/lib/libc/gen/getfsent.3
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1983, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: getfsent.3,v 1.4 1995/02/27 04:12:33 cgd Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 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
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getfsent.3 6.9 (Berkeley) 4/19/91
-.\" $Id: getfsent.3,v 1.3 1993/11/25 02:48:58 jtc Exp $
+.\" @(#)getfsent.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd April 19, 1991
+.Dd June 4, 1993
.Dt GETFSENT 3
.Os BSD 4
.Sh NAME
diff --git a/lib/libc/gen/getgrent.3 b/lib/libc/gen/getgrent.3
index 3e3931e4434..d5e48140eef 100644
--- a/lib/libc/gen/getgrent.3
+++ b/lib/libc/gen/getgrent.3
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1989, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: getgrent.3,v 1.8 1995/02/27 04:12:36 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 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
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getgrent.3 6.8 (Berkeley) 4/20/91
-.\" $Id: getgrent.3,v 1.7 1994/01/10 23:32:28 jtc Exp $
+.\" @(#)getgrent.3 8.2 (Berkeley) 4/19/94
.\"
-.Dd April 20, 1991
+.Dd April 19, 1994
.Dt GETGRENT 3
.Os
.Sh NAME
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 8716cbcc194..62b59d5a248 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getgrent.c,v 1.11 1995/02/27 04:12:39 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 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
@@ -32,8 +34,11 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getgrent.c 5.9 (Berkeley) 4/1/91";*/
-static char *rcsid = "$Id: getgrent.c,v 1.10 1994/08/02 05:15:25 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)getgrent.c 8.2 (Berkeley) 3/21/94";
+#else
+static char rcsid[] = "$NetBSD: getgrent.c,v 1.11 1995/02/27 04:12:39 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
diff --git a/lib/libc/gen/gethostname.3 b/lib/libc/gen/gethostname.3
index fcb0303d7bb..ebb7fc4042a 100644
--- a/lib/libc/gen/gethostname.3
+++ b/lib/libc/gen/gethostname.3
@@ -1,3 +1,5 @@
+.\" $NetBSD: gethostname.3,v 1.2 1995/02/27 04:12:42 cgd Exp $
+.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
diff --git a/lib/libc/gen/gethostname.c b/lib/libc/gen/gethostname.c
index 058e4b6bff4..2433719b166 100644
--- a/lib/libc/gen/gethostname.c
+++ b/lib/libc/gen/gethostname.c
@@ -1,3 +1,5 @@
+/* $NetBSD: gethostname.c,v 1.2 1995/02/27 04:12:45 cgd Exp $ */
+
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,7 +34,11 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
static char sccsid[] = "@(#)gethostname.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: gethostname.c,v 1.2 1995/02/27 04:12:45 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
diff --git a/lib/libc/gen/getlogin.c b/lib/libc/gen/getlogin.c
index 563f6bd05f3..fea4913d1ce 100644
--- a/lib/libc/gen/getlogin.c
+++ b/lib/libc/gen/getlogin.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getlogin.c,v 1.6 1995/02/27 04:12:47 cgd Exp $ */
+
/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 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
@@ -32,8 +34,11 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getlogin.c 5.9 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id: getlogin.c,v 1.5 1993/12/18 01:16:18 jtc Exp $";
+#if 0
+static char sccsid[] = "@(#)getlogin.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: getlogin.c,v 1.6 1995/02/27 04:12:47 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
diff --git a/lib/libc/gen/getmntinfo.3 b/lib/libc/gen/getmntinfo.3
index 135552dbb12..946dd016ba1 100644
--- a/lib/libc/gen/getmntinfo.3
+++ b/lib/libc/gen/getmntinfo.3
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1989, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: getmntinfo.3,v 1.5 1995/02/27 04:12:50 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 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
@@ -29,17 +31,17 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getmntinfo.3 6.5 (Berkeley) 4/19/91
-.\" $Id: getmntinfo.3,v 1.4 1994/08/29 03:27:36 mycroft Exp $
+.\" @(#)getmntinfo.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd April 19, 1991
+.Dd June 9, 1993
.Dt GETMNTINFO 3
.Os
.Sh NAME
.Nm getmntinfo
.Nd get information about mounted file systems
.Sh SYNOPSIS
-.Fd #include <sys/types.h>
+.Fd #include <sys/param.h>
+.Fd #include <sys/ucred.h>
.Fd #include <sys/mount.h>
.Ft int
.Fn getmntinfo "struct statfs **mntbufp" "int flags"
@@ -92,8 +94,7 @@ or
.Sh HISTORY
The
.Fn getmntinfo
-function is
-.Ud .
+function first appeared in 4.4BSD.
.Sh BUGS
The
.Fn getmntinfo
diff --git a/lib/libc/gen/getmntinfo.c b/lib/libc/gen/getmntinfo.c
index 151cfc903b5..ce5368379a2 100644
--- a/lib/libc/gen/getmntinfo.c
+++ b/lib/libc/gen/getmntinfo.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getmntinfo.c,v 1.5 1995/02/27 04:12:53 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 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
@@ -32,11 +34,15 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getmntinfo.c 6.4 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id: getmntinfo.c,v 1.4 1994/06/12 22:52:03 cgd Exp $";
+#if 0
+static char sccsid[] = "@(#)getmntinfo.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: getmntinfo.c,v 1.5 1995/02/27 04:12:53 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
+#include <sys/ucred.h>
#include <sys/mount.h>
#include <stdlib.h>
diff --git a/lib/libc/gen/getpagesize.3 b/lib/libc/gen/getpagesize.3
index 1a2629740b7..7f9f3a4f184 100644
--- a/lib/libc/gen/getpagesize.3
+++ b/lib/libc/gen/getpagesize.3
@@ -1,3 +1,5 @@
+.\" $NetBSD: getpagesize.3,v 1.2 1995/02/27 04:12:55 cgd Exp $
+.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
diff --git a/lib/libc/gen/getpass.3 b/lib/libc/gen/getpass.3
index b3ec6cb5cb1..b24ff94cbf4 100644
--- a/lib/libc/gen/getpass.3
+++ b/lib/libc/gen/getpass.3
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1989, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: getpass.3,v 1.4 1995/02/27 04:12:57 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 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
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getpass.3 6.5 (Berkeley) 5/21/91
-.\" $Id: getpass.3,v 1.3 1993/11/29 21:41:04 jtc Exp $
+.\" @(#)getpass.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd May 21, 1991
+.Dd June 4, 1993
.Dt GETPASS 3
.Os
.Sh NAME
diff --git a/lib/libc/gen/getpass.c b/lib/libc/gen/getpass.c
index d023b93317e..9352fcb0842 100644
--- a/lib/libc/gen/getpass.c
+++ b/lib/libc/gen/getpass.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getpass.c,v 1.5 1995/02/27 04:12:59 cgd Exp $ */
+
/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 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
@@ -32,16 +34,20 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getpass.c 5.9 (Berkeley) 5/6/91";*/
-static char *rcsid = "$Id: getpass.c,v 1.4 1994/01/04 18:27:08 jtc Exp $";
+#if 0
+static char sccsid[] = "@(#)getpass.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: getpass.c,v 1.5 1995/02/27 04:12:59 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/termios.h>
#include <sys/signal.h>
+
+#include <paths.h>
+#include <pwd.h>
#include <stdio.h>
#include <unistd.h>
-#include <pwd.h>
-#include <paths.h>
char *
getpass(prompt)
@@ -82,7 +88,7 @@ getpass(prompt)
(void)write(fileno(outfp), "\n", 1);
if (echo) {
term.c_lflag |= ECHO;
- tcsetattr(fileno(fp), TCSAFLUSH|TCSASOFT, &term);
+ (void)tcsetattr(fileno(fp), TCSAFLUSH|TCSASOFT, &term);
}
(void)sigsetmask(omask);
if (fp != stdin)
diff --git a/lib/libc/gen/getpwent.3 b/lib/libc/gen/getpwent.3
index d36fb144525..2a74c989de2 100644
--- a/lib/libc/gen/getpwent.3
+++ b/lib/libc/gen/getpwent.3
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1988, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: getpwent.3,v 1.7 1995/02/27 04:13:01 cgd Exp $
+.\"
+.\" Copyright (c) 1988, 1991, 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
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getpwent.3 6.8 (Berkeley) 4/19/91
-.\" $Id: getpwent.3,v 1.6 1995/01/03 15:57:32 jtc Exp $
+.\" @(#)getpwent.3 8.2 (Berkeley) 12/11/93
.\"
-.Dd April 19, 1991
+.Dd December 11, 1993
.Dt GETPWENT 3
.Os
.Sh NAME
@@ -113,7 +114,7 @@ up subsequent accesses for all of the routines.
as it doesn't close its file descriptors by default.)
.Pp
It is dangerous for long-running programs to keep the file descriptors
-open the database will become out of date if it is updated while the
+open as the database will become out of date if it is updated while the
program is running.
.Pp
The
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 1e0b4383bc7..ccd671b75b4 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getpwent.c,v 1.12 1995/02/27 04:13:05 cgd Exp $ */
+
/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 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
@@ -32,8 +34,11 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getpwent.c 5.21 (Berkeley) 3/14/91";*/
-static char *rcsid = "$Id: getpwent.c,v 1.11 1994/03/09 10:10:29 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)getpwent.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: getpwent.c,v 1.12 1995/02/27 04:13:05 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
diff --git a/lib/libc/gen/getsubopt.3 b/lib/libc/gen/getsubopt.3
index 1c80b5c6fe4..5074ceae1b8 100644
--- a/lib/libc/gen/getsubopt.3
+++ b/lib/libc/gen/getsubopt.3
@@ -1,3 +1,5 @@
+.\" $NetBSD: getsubopt.3,v 1.3 1995/02/27 04:13:09 cgd Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,8 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getsubopt.3 5.4 (Berkeley) 7/31/91
-.\" $Id: getsubopt.3,v 1.2 1993/07/30 08:36:45 mycroft Exp $
+.\" @(#)getsubopt.3 5.4 (Berkeley) 7/31/91
.\"
.Dd July 31, 1991
.Dt GETSUBOPT 3
diff --git a/lib/libc/gen/getsubopt.c b/lib/libc/gen/getsubopt.c
index d4531d36d9c..9fc0fa5283a 100644
--- a/lib/libc/gen/getsubopt.c
+++ b/lib/libc/gen/getsubopt.c
@@ -1,3 +1,5 @@
+/* $NetBSD: getsubopt.c,v 1.4 1995/02/27 04:13:12 cgd Exp $ */
+
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -32,8 +34,11 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getsubopt.c 5.2 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id: getsubopt.c,v 1.3 1993/08/26 00:44:43 jtc Exp $";
+#if 0
+static char *sccsid = "@(#)getsubopt.c 5.2 (Berkeley) 2/24/91";
+#else
+static char rcsid[] = "$NetBSD: getsubopt.c,v 1.4 1995/02/27 04:13:12 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
diff --git a/lib/libc/gen/getttyent.3 b/lib/libc/gen/getttyent.3
index bf2fc49313f..94adb769aff 100644
--- a/lib/libc/gen/getttyent.3
+++ b/lib/libc/gen/getttyent.3
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1989, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: getttyent.3,v 1.6 1995/02/27 04:13:16 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 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
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getttyent.3 6.7 (Berkeley) 4/19/91
-.\" $Id: getttyent.3,v 1.5 1994/03/30 06:31:02 cgd Exp $
+.\" @(#)getttyent.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd April 19, 1991
+.Dd June 4, 1993
.Dt GETTTYENT 3
.Os BSD 4.3
.Sh NAME
diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c
index 130b7fa82e8..f7342c0f5df 100644
--- a/lib/libc/gen/getttyent.c
+++ b/lib/libc/gen/getttyent.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getttyent.c,v 1.8 1995/02/27 04:13:20 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 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
@@ -32,8 +34,11 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getttyent.c 5.10 (Berkeley) 3/23/91";*/
-static char *rcsid = "$Id: getttyent.c,v 1.7 1994/03/30 08:22:07 cgd Exp $";
+#if 0
+static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: getttyent.c,v 1.8 1995/02/27 04:13:20 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <ttyent.h>
diff --git a/lib/libc/gen/getusershell.3 b/lib/libc/gen/getusershell.3
index 0b4f47f6415..84dc3ad932b 100644
--- a/lib/libc/gen/getusershell.3
+++ b/lib/libc/gen/getusershell.3
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1985, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: getusershell.3,v 1.3 1995/02/27 04:13:24 cgd Exp $
+.\"
+.\" Copyright (c) 1985, 1991, 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
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)getusershell.3 6.5 (Berkeley) 4/19/91
-.\" $Id: getusershell.3,v 1.2 1993/07/30 08:36:52 mycroft Exp $
+.\" @(#)getusershell.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd April 19, 1991
+.Dd June 4, 1993
.Dt GETUSERSHELL 3
.Os BSD 4.3
.Sh NAME
diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c
index b6784b4338e..bef77271f1e 100644
--- a/lib/libc/gen/getusershell.c
+++ b/lib/libc/gen/getusershell.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getusershell.c,v 1.5 1995/02/27 04:13:27 cgd Exp $ */
+
/*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1985, 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
@@ -32,32 +34,33 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/*static char *sccsid = "from: @(#)getusershell.c 5.7 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id: getusershell.c,v 1.4 1993/08/26 00:44:45 jtc Exp $";
+#if 0
+static char sccsid[] = "@(#)getusershell.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: getusershell.c,v 1.5 1995/02/27 04:13:27 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
#include <sys/file.h>
#include <sys/stat.h>
-#include <ctype.h>
#include <stdio.h>
+#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
-
-#define SHELLS "/etc/shells"
+#include <paths.h>
/*
- * Do not add local shells here. They should be added in /etc/shells
+ * Local shells should NOT be added here. They should be added in
+ * /etc/shells.
*/
-static char *okshells[] =
- { "/bin/sh", "/bin/csh", 0 };
-static char **shells, *strings;
-static char **curshell = NULL;
-static char **initshells();
+static char *okshells[] = { _PATH_BSHELL, _PATH_CSHELL, NULL };
+static char **curshell, **shells, *strings;
+static char **initshells __P((void));
/*
- * Get a list of shells from SHELLS, if it exists.
+ * Get a list of shells from _PATH_SHELLS, if it exists.
*/
char *
getusershell()
@@ -77,7 +80,7 @@ endusershell()
{
if (shells != NULL)
- free((char *)shells);
+ free(shells);
shells = NULL;
if (strings != NULL)
free(strings);
@@ -100,27 +103,27 @@ initshells()
struct stat statb;
if (shells != NULL)
- free((char *)shells);
+ free(shells);
shells = NULL;
if (strings != NULL)
free(strings);
strings = NULL;
- if ((fp = fopen(SHELLS, "r")) == (FILE *)0)
- return(okshells);
+ if ((fp = fopen(_PATH_SHELLS, "r")) == NULL)
+ return (okshells);
if (fstat(fileno(fp), &statb) == -1) {
(void)fclose(fp);
- return(okshells);
+ return (okshells);
}
- if ((strings = malloc((unsigned)statb.st_size)) == NULL) {
+ if ((strings = malloc((u_int)statb.st_size)) == NULL) {
(void)fclose(fp);
- return(okshells);
+ return (okshells);
}
- shells = (char **)calloc((unsigned)statb.st_size / 3, sizeof (char *));
+ shells = calloc((unsigned)statb.st_size / 3, sizeof (char *));
if (shells == NULL) {
(void)fclose(fp);
free(strings);
strings = NULL;
- return(okshells);
+ return (okshells);
}
sp = shells;
cp = strings;
@@ -134,7 +137,7 @@ initshells()
cp++;
*cp++ = '\0';
}
- *sp = (char *)0;
+ *sp = NULL;
(void)fclose(fp);
return (shells);
}
diff --git a/lib/libc/gen/glob.3 b/lib/libc/gen/glob.3
index b681a8484e6..403febdd8b2 100644
--- a/lib/libc/gen/glob.3
+++ b/lib/libc/gen/glob.3
@@ -1,4 +1,6 @@
-.\" Copyright (c) 1989, 1991, 1993
+.\" $NetBSD: glob.3,v 1.9 1995/02/27 04:13:30 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
@@ -31,10 +33,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)glob.3 8.1 (Berkeley) 6/9/93
-.\" $Id: glob.3,v 1.8 1994/01/06 13:24:09 deraadt Exp $
+.\" @(#)glob.3 8.3 (Berkeley) 4/16/94
.\"
-.Dd June 9, 1993
+.Dd April 16, 1994
.Dt GLOB 3
.Os
.Sh NAME
@@ -381,10 +382,24 @@ The arguments
and
.Fa pglob\->gl_pathv
are still set as specified above.
+.Sh EXAMPLE
+A rough equivalent of
+.Ql "ls -l *.c *.h"
+can be obtained with the
+following code:
+.Bd -literal -offset indent
+glob_t g;
+
+g.gl_offs = 2;
+glob("*.c", GLOB_DOOFFS, NULL, &g);
+glob("*.h", GLOB_DOOFFS | GLOB_APPEND, NULL, &g);
+g.gl_pathv[0] = "ls";
+g.gl_pathv[1] = "-l";
+execvp("ls", g.gl_pathv);
+.Ed
.Sh SEE ALSO
.Xr sh 1 ,
.Xr fnmatch 3 ,
-.Xr wordexp 3 ,
.Xr regexp 3
.Sh STANDARDS
The
@@ -407,21 +422,6 @@ and
should not be used by applications striving for strict
.Tn POSIX
conformance.
-.Sh EXAMPLE
-A rough equivalent of
-.Ql "ls -l *.c *.h"
-can be obtained with the
-following code:
-.Bd -literal -offset indent
-glob_t g;
-
-g.gl_offs = 2;
-glob("*.c", GLOB_DOOFFS, NULL, &g);
-glob("*.h", GLOB_DOOFFS | GLOB_APPEND, NULL, &g);
-g.gl_pathv[0] = "ls";
-g.gl_pathv[1] = "-l";
-execvp("ls", g.gl_pathv);
-.Ed
.Sh HISTORY
The
.Fn glob
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index 77c5cefc6c1..a384440532f 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -1,3 +1,5 @@
+/* $NetBSD: glob.c,v 1.5 1995/02/27 04:13:35 cgd Exp $ */
+
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,8 +37,11 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-/* from: static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; */
-static char *rcsid = "$Id: glob.c,v 1.4 1993/11/06 01:10:18 cgd Exp $";
+#if 0
+static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93";
+#else
+static char rcsid[] = "$NetBSD: glob.c,v 1.5 1995/02/27 04:13:35 cgd Exp $";
+#endif
#endif /* LIBC_SCCS and not lint */
/*