Commit | Line | Data |
---|---|---|
ae59e04c | 1 | .\" Copyright (c) 1985, 1991 The Regents of the University of California. |
65b85f8f | 2 | .\" All rights reserved. |
778f0f70 | 3 | .\" |
91cff1e1 | 4 | .\" %sccs.include.redist.man% |
65b85f8f | 5 | .\" |
ae59e04c | 6 | .\" @(#)getusershell.3 6.5 (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 | |
24 | The | |
25 | .Fn getusershell | |
26 | function | |
778f0f70 KM |
27 | returns a pointer to a legal user shell as defined by the |
28 | system manager in the file | |
ae59e04c | 29 | .Pa /etc/shells . |
778f0f70 | 30 | If |
ae59e04c | 31 | .Pa /etc/shells |
fe953ca4 | 32 | is unreadable or does not exist, |
ae59e04c | 33 | .Fn getusershell |
fe953ca4 | 34 | behaves as if |
ae59e04c | 35 | .Pa /bin/sh |
778f0f70 | 36 | and |
ae59e04c | 37 | .Pa /bin/csh |
fe953ca4 | 38 | were listed in the file. |
ae59e04c CL |
39 | .Pp |
40 | The | |
41 | .Fn getusershell | |
42 | function | |
778f0f70 KM |
43 | reads the next |
44 | line (opening the file if necessary); | |
ae59e04c | 45 | .Fn setusershell |
778f0f70 | 46 | rewinds the file; |
ae59e04c | 47 | .Fn endusershell |
778f0f70 | 48 | closes it. |
ae59e04c CL |
49 | .Sh FILES |
50 | .Bl -tag -width /etc/shells -compact | |
51 | .It Pa /etc/shells | |
52 | .El | |
53 | .Sh DIAGNOSTICS | |
778f0f70 | 54 | The routine |
ae59e04c CL |
55 | .Fn getusershell |
56 | returns a null pointer (0) on | |
57 | .Dv EOF . | |
58 | .Sh SEE ALSO | |
59 | .Xr shells 5 | |
60 | .Sh HISTORY | |
61 | The | |
62 | .Fn getusershell | |
63 | function appeared in | |
64 | .Bx 4.3 . | |
65 | .Sh BUGS | |
66 | The | |
67 | .Fn getusershell | |
68 | function leaves its result in an internal static object and returns | |
69 | a pointer to that object. Subsequent calls to | |
70 | .Fn getusershell | |
71 | will modify the same object. |