OSDN Git Service

1ce9812b66c969bcc36c029f46ae7a6b5ec34957
[linuxjm/LDP_man-pages.git] / original / man3 / getusershell.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified Sat Jul 24 19:17:53 1993 by Rik Faith (faith@cs.unc.edu)
30 .TH GETUSERSHELL 3  2013-06-21 "GNU" "Linux Programmer's Manual"
31 .SH NAME
32 getusershell, setusershell, endusershell \- get permitted user shells
33 .SH SYNOPSIS
34 .nf
35 .B #include <unistd.h>
36 .sp
37 .B char *getusershell(void);
38 .sp
39 .B void setusershell(void);
40 .sp
41 .B void endusershell(void);
42 .fi
43 .sp
44 .in -4n
45 Feature Test Macro Requirements for glibc (see
46 .BR feature_test_macros (7)):
47 .in
48 .sp
49 .ad l
50 .BR getusershell (),
51 .BR setusershell (),
52 .BR endusershell ():
53 .RS 4
54 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
55 .RE
56 .ad b
57 .SH DESCRIPTION
58 The
59 .BR getusershell ()
60 function returns the next line from the file
61 .IR /etc/shells ,
62 opening the file if necessary.
63 The line should contain
64 the pathname of a valid user shell.
65 If
66 .I /etc/shells
67 does not exist or
68 is unreadable,
69 .BR getusershell ()
70 behaves as if
71 .I /bin/sh
72 and
73 .I /bin/csh
74 were listed in the file.
75 .PP
76 The
77 .BR setusershell ()
78 function rewinds
79 .IR /etc/shells .
80 .PP
81 The
82 .BR endusershell ()
83 function closes
84 .IR /etc/shells .
85 .SH RETURN VALUE
86 The
87 .BR getusershell ()
88 function returns NULL on end-of-file.
89 .SH FILES
90 .nf
91 /etc/shells
92 .fi
93 .SH ATTRIBUTES
94 .SS Multithreading (see pthreads(7))
95 The
96 .BR getusershell (),
97 .BR setusershell ()
98 and
99 .BR endusershell ()
100 functions are not thread-safe.
101 .SH CONFORMING TO
102 4.3BSD.
103 .SH SEE ALSO
104 .BR shells (5)
105 .SH COLOPHON
106 This page is part of release 3.67 of the Linux
107 .I man-pages
108 project.
109 A description of the project,
110 information about reporting bugs,
111 and the latest version of this page,
112 can be found at
113 \%http://www.kernel.org/doc/man\-pages/.