1GETUSERSHELL(3)            Linux Programmer's Manual           GETUSERSHELL(3)
2
3
4

NAME

6       getusershell, setusershell, endusershell - get permitted user shells
7

SYNOPSIS

9       #include <unistd.h>
10
11       char *getusershell(void);
12
13       void setusershell(void);
14
15       void endusershell(void);
16
17   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19       getusershell(), setusershell(), endusershell():
20           Since glibc 2.21:
21               _DEFAULT_SOURCE
22           In glibc 2.19 and 2.20:
23               _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
24           Up to and including glibc 2.19:
25               _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
26

DESCRIPTION

28       The  getusershell()  function  returns  the  next  line  from  the file
29       /etc/shells, opening the file if necessary.  The  line  should  contain
30       the  pathname  of a valid user shell.  If /etc/shells does not exist or
31       is unreadable, getusershell() behaves as if /bin/sh and  /bin/csh  were
32       listed in the file.
33
34       The setusershell() function rewinds /etc/shells.
35
36       The endusershell() function closes /etc/shells.
37

RETURN VALUE

39       The getusershell() function returns NULL on end-of-file.
40

FILES

42       /etc/shells
43

ATTRIBUTES

45       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
46       tributes(7).
47
48       ┌────────────────────────────────┬───────────────┬───────────┐
49Interface                       Attribute     Value     
50       ├────────────────────────────────┼───────────────┼───────────┤
51getusershell(), setusershell(), │ Thread safety │ MT-Unsafe │
52endusershell()                  │               │           │
53       └────────────────────────────────┴───────────────┴───────────┘

CONFORMING TO

55       4.3BSD.
56

SEE ALSO

58       shells(5)
59

COLOPHON

61       This page is part of release 5.10 of the Linux  man-pages  project.   A
62       description  of  the project, information about reporting bugs, and the
63       latest    version    of    this    page,    can     be     found     at
64       https://www.kernel.org/doc/man-pages/.
65
66
67
68GNU                               2016-03-15                   GETUSERSHELL(3)
Impressum