4.4BSD snapshot (revision 8.1)
[unix-history] / usr / src / lib / libc / gen / getusershell.3
CommitLineData
74155b62
KB
1.\" Copyright (c) 1985, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
778f0f70 3.\"
91cff1e1 4.\" %sccs.include.redist.man%
65b85f8f 5.\"
74155b62 6.\" @(#)getusershell.3 8.1 (Berkeley) %G%
778f0f70 7.\"
ae59e04c
CL
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
778f0f70
KM
27returns a pointer to a legal user shell as defined by the
28system manager in the file
ae59e04c 29.Pa /etc/shells .
778f0f70 30If
ae59e04c 31.Pa /etc/shells
fe953ca4 32is unreadable or does not exist,
ae59e04c 33.Fn getusershell
fe953ca4 34behaves as if
ae59e04c 35.Pa /bin/sh
778f0f70 36and
ae59e04c 37.Pa /bin/csh
fe953ca4 38were listed in the file.
ae59e04c
CL
39.Pp
40The
41.Fn getusershell
42function
778f0f70
KM
43reads the next
44line (opening the file if necessary);
ae59e04c 45.Fn setusershell
778f0f70 46rewinds the file;
ae59e04c 47.Fn endusershell
778f0f70 48closes it.
ae59e04c
CL
49.Sh FILES
50.Bl -tag -width /etc/shells -compact
51.It Pa /etc/shells
52.El
53.Sh DIAGNOSTICS
778f0f70 54The routine
ae59e04c
CL
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.