remove csh(1)
[unleashed.git] / share / man / man3c / getusershell.3c
blob631994a69229ec0b1b51f61b4a367bdb33d1301f
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Copyright (c) 1985 Regents of the University of California.  All rights reserved.  The Berkeley software License Agreement specifies the terms and conditions for redistribution.
4 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
5 .TH GETUSERSHELL 3C "Nov 1, 2007"
6 .SH NAME
7 getusershell, setusershell, endusershell \- get legal user shells
8 .SH SYNOPSIS
9 .LP
10 .nf
11 #include <unistd.h>
13 \fBchar *\fR\fBgetusershell\fR(\fBvoid\fR);
14 .fi
16 .LP
17 .nf
18 \fBvoid\fR \fBsetusershell\fR(\fBvoid\fR);
19 .fi
21 .LP
22 .nf
23 \fBvoid\fR \fBendusershell\fR(\fBvoid\fR);
24 .fi
26 .SH DESCRIPTION
27 .sp
28 .LP
29 The \fBgetusershell()\fR function returns a pointer to a legal user shell as
30 defined by the system manager in the file \fB/etc/shells\fR. If
31 \fB/etc/shells\fR does not exist, the following locations of the standard
32 system shells are used in its place:
33 .sp
34 .in +2
35 .nf
36 \fB/bin/bash\fR
37 \fB/bin/jsh\fR                   \fB/bin/ksh\fR
38 \fB/bin/ksh93\fR
39 \fB/bin/pfksh\fR                 \fB/bin/pfsh\fR
40 \fB/bin/sh\fR
41 \fB/bin/zsh\fR                   \fB/sbin/jsh\fR
42 \fB/sbin/pfsh\fR                 \fB/sbin/sh\fR
43 \fB/usr/bin/bash\fR
44 \fB/usr/bin/jsh\fR               \fB/usr/bin/ksh\fR
45 \fB/usr/bin/ksh93\fR
46 \fB/usr/bin/pfksh\fR             \fB/usr/bin/pfsh\fR
47 \fB/usr/bin/sh\fR
48 \fB/usr/bin/zsh\fR               \fB/usr/sfw/bin/zsh\fR
49 .fi
50 .in -2
52 .sp
53 .LP
54 The \fBgetusershell()\fR function opens the file \fB/etc/shells\fR, if it
55 exists, and returns the next entry in the list of shells.
56 .sp
57 .LP
58 The \fBsetusershell()\fR function rewinds the file or the list.
59 .sp
60 .LP
61 The \fBendusershell()\fR function closes the file, frees any memory used by
62 \fBgetusershell()\fR and \fBsetusershell()\fR, and rewinds the file
63 \fB/etc/shells\fR.
64 .SH RETURN VALUES
65 .sp
66 .LP
67 The \fBgetusershell()\fR function returns a null pointer on EOF.
68 .SH BUGS
69 .sp
70 .LP
71 All information is contained in memory that may be freed with a call to
72 \fBendusershell()\fR, so it must be copied if it is to be saved.
73 .SH NOTES
74 .sp
75 .LP
76 Restricted shells should not be listed in \fB/etc/shells\fR.