man pages section 3: Basic Library Functions
검색에만이 책은
이 책의 내용보기:
PDF로 이 문서 다운로드 (3779 KB)

getusershell(3C)

Name | Synopsis | Description | Return Values | Bugs | Notes

Name

    getusershell, setusershell, endusershell– get legal user shells

Synopsis

    #include <unistd.h>
    
    char *getusershell(void);
    void setusershell(void);
    void endusershell(void);

Description

    The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place:

    /bin/bash                  /bin/csh
    /bin/jsh                   /bin/ksh
    /bin/pfcsh                 /bin/pfksh
    /bin/pfsh                  /bin/sh
    /bin/tcsh                  /bin/zsh
    /sbin/jsh                  /sbin/pfsh
    /sbin/sh                   /usr/bin/bash
    /usr/bin/csh               /usr/bin/jsh
    /usr/bin/ksh               /usr/bin/pfcsh
    /usr/bin/pfksh             /usr/bin/pfsh
    /usr/bin/sh                /usr/bin/tcsh
    /usr/bin/zsh               /usr/sfw/bin/zsh
    /usr/xpg4/bin/sh
    

    The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells.

    The setusershell() function rewinds the file or the list.

    The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells.

Return Values

    The getusershell() function returns a null pointer on EOF.

Bugs

    All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved.

Notes

    Restricted shells should not be listed in /etc/shells.

SunOS 5.10 Last Revised 19 Sep 2006

Name | Synopsis | Description | Return Values | Bugs | Notes