add Berkeley copyright
[unix-history] / usr / src / lib / libc / gen / getusershell.3
CommitLineData
65b85f8f
KB
1.\" Copyright (c) 1985 The Regents of the University of California.
2.\" All rights reserved.
778f0f70 3.\"
65b85f8f
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
16.\" @(#)getusershell.3 6.3 (Berkeley) %G%
778f0f70
KM
17.\"
18.TH GETUSERSHELL 3 ""
19.UC 6
20.SH NAME
21getusershell, setusershell, endusershell \- get legal user shells
22.SH SYNOPSIS
23.nf
24.B char *getusershell()
25.PP
26.B setusershell()
27.PP
28.B endusershell()
29.fi
30.SH DESCRIPTION
31.I Getusershell
32returns a pointer to a legal user shell as defined by the
33system manager in the file
34.IR /etc/shells .
35If
36.I /etc/shells
fe953ca4
KB
37is unreadable or does not exist,
38.I getusershell
39behaves as if
778f0f70
KM
40.I /bin/sh
41and
42.I /bin/csh
fe953ca4 43were listed in the file.
778f0f70
KM
44.PP
45.I Getusershell
46reads the next
47line (opening the file if necessary);
48.I setusershell
49rewinds the file;
50.I endusershell
51closes it.
52.SH FILES
53/etc/shells
fe953ca4
KB
54.SH "SEE ALSO"
55shells(5)
778f0f70
KM
56.SH DIAGNOSTICS
57The routine
58.I getusershell
fe953ca4 59returns a null pointer (0) on EOF.
778f0f70
KM
60.SH BUGS
61All information
62is contained in a static area
63so it must be copied if it is
64to be saved.