xref: /original-bsd/lib/libc/gen/getusershell.3 (revision c3e32dec)
1.\" Copyright (c) 1985, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)getusershell.3	8.1 (Berkeley) 06/04/93
7.\"
8.Dd
9.Dt GETUSERSHELL 3
10.Os BSD 4.3
11.Sh NAME
12.Nm getusershell ,
13.Nm setusershell ,
14.Nm endusershell
15.Nd get legal user shells
16.Sh SYNOPSIS
17.Ft char *
18.Fn getusershell void
19.Ft void
20.Fn setusershell void
21.Ft void
22.Fn endusershell void
23.Sh DESCRIPTION
24The
25.Fn getusershell
26function
27returns a pointer to a legal user shell as defined by the
28system manager in the file
29.Pa /etc/shells .
30If
31.Pa /etc/shells
32is unreadable or does not exist,
33.Fn getusershell
34behaves as if
35.Pa /bin/sh
36and
37.Pa /bin/csh
38were listed in the file.
39.Pp
40The
41.Fn getusershell
42function
43reads the next
44line (opening the file if necessary);
45.Fn setusershell
46rewinds the file;
47.Fn endusershell
48closes it.
49.Sh FILES
50.Bl -tag -width /etc/shells -compact
51.It Pa /etc/shells
52.El
53.Sh DIAGNOSTICS
54The routine
55.Fn getusershell
56returns a null pointer (0) on
57.Dv EOF .
58.Sh SEE ALSO
59.Xr shells 5
60.Sh HISTORY
61The
62.Fn getusershell
63function appeared in
64.Bx 4.3 .
65.Sh BUGS
66The
67.Fn getusershell
68function leaves its result in an internal static object and returns
69a pointer to that object. Subsequent calls to
70.Fn getusershell
71will modify the same object.
72