*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> setusershell (3)              
Title
Content
Arch
Section
 

getusershell(3)

Contents


NAME    [Toc]    [Back]

       getusershell,   getusershell_r,   setusershell,   setusershell_r,
 endusershell, endusershell_r - Get the  names  of
       legal user shells

SYNOPSIS    [Toc]    [Back]

       char *getusershell(
               void ); int setusershell(
               void ); int endusershell(
               void );

       The following obsolete functions are supported in order to
       maintain backward compatibility with previous versions  of
       the  operating  system.  You  should  not  use them in new
       designs.  int getusershell_r(
               char *shell,
               int len,
               unsigned int *state ); int setusershell_r(
               unsigned int *state ); int endusershell(
               unsigned int *state );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

PARAMETERS    [Toc]    [Back]

       Points to a buffer for  the  shell  name.   Specifies  the
       length of the shell parameter.  Points to a variable which
       stores information about the contents of  the  /etc/shells
       file.

DESCRIPTION    [Toc]    [Back]

       The  getusershell() function returns a pointer to a string
       that contains the name of a legal user shell as defined by
       the  system  manager  in  the  /etc/shells  file.  If  the
       /etc/shells file  does  not  exist,  the  standard  system
       shells are returned.

       On  subsequent  calls, the getusershell() function returns
       the next shell. The  endusershell()  function  resets  the
       list so that subsequent calls of getusershell() reread the
       list from /etc/shells. The setusershell() function rereads
       the list from /etc/shells and subsequent calls of getusershell()
 start from the beginning.

NOTES    [Toc]    [Back]

       The getusershell() function returns a pointer  to  threadspecific
  data.  Subsequent calls to the function from the
       same thread overwrite this data.

       The  getusershell_r(),  setusershell_r(),   and   endusershell_r()
 functions are obsolete reentrant versions of the
       getusershell(), setusershell(), and  endusershell()  functions.
  They  are  supported in order to maintain backward
       compatibility with previous versions of the operating system
  and  should not be used in new designs. Note that you
       must initialize the state parameter to 0 (zero) before its
       first access by any of these functions.





RETURN VALUES    [Toc]    [Back]

       Upon  successful  completion,  the getusershell() function
       returns a pointer to a character string. If  it  fails  or
       reaches  the  end  of  the  shell  file, it returns a null
       pointer.

       Upon successful completion, the getusershell_r()  function
       stores  a pointer to the shell name in shell and returns a
       value of 0 (zero). Upon failure, it returns a value of  -1
       and places an appropriate value in the errno variable.

       Upon  successful completion, the setusershell_r() function
       returns a value of 0 (zero). Upon failure,  it  returns  a
       value  of  -1 and places an appropriate value in the errno
       variable.

       The endusershell_r() function always returns a value of  0
       (zero).

ERRORS    [Toc]    [Back]

       If  any  of  the following conditions occurs, the getusershell_r()
 function sets errno to the corresponding value:

       Either the shell parameter is invalid, the  len  parameter
       is  too  small,  or the state parameter is a null pointer.
       The end of the shell list has been reached (EOF).

       If the following condition  occurs,  the  setusershell_r()
       function  sets errno to the corresponding value: Unable to
       allocate memory for the reread list of shells.

FILES    [Toc]    [Back]

       Contains the names of legal user shells.

SEE ALSO    [Toc]    [Back]

      
      
       Files: shells(4).



                                                  getusershell(3)
[ Back ]
 Similar pages
Name OS Title
setusershell OpenBSD get legal user shells
endusershell OpenBSD get legal user shells
getusershell Linux get legal user shells
getusershell OpenBSD get legal user shells
setusershell FreeBSD get valid user shells
getusershell NetBSD get valid user shells
setusershell NetBSD get valid user shells
endusershell NetBSD get valid user shells
getusershell FreeBSD get valid user shells
endusershell FreeBSD get valid user shells
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service