1*61111Sbostic.\" Copyright (c) 1985, 1991, 1993 2*61111Sbostic.\" The Regents of the University of California. All rights reserved. 325431Smckusick.\" 443571Strent.\" %sccs.include.redist.man% 525431Smckusick.\" 6*61111Sbostic.\" @(#)getusershell.3 8.1 (Berkeley) 06/04/93 736275Sbostic.\" 848352Scael.Dd 948352Scael.Dt GETUSERSHELL 3 1048352Scael.Os BSD 4.3 1148352Scael.Sh NAME 1248352Scael.Nm getusershell , 1348352Scael.Nm setusershell , 1448352Scael.Nm endusershell 1548352Scael.Nd get legal user shells 1648352Scael.Sh SYNOPSIS 1748352Scael.Ft char * 1848352Scael.Fn getusershell void 1948352Scael.Ft void 2048352Scael.Fn setusershell void 2148352Scael.Ft void 2248352Scael.Fn endusershell void 2348352Scael.Sh DESCRIPTION 2448352ScaelThe 2548352Scael.Fn getusershell 2648352Scaelfunction 2725431Smckusickreturns a pointer to a legal user shell as defined by the 2825431Smckusicksystem manager in the file 2948352Scael.Pa /etc/shells . 3025431SmckusickIf 3148352Scael.Pa /etc/shells 3230235Sbosticis unreadable or does not exist, 3348352Scael.Fn getusershell 3430235Sbosticbehaves as if 3548352Scael.Pa /bin/sh 3625431Smckusickand 3748352Scael.Pa /bin/csh 3830235Sbosticwere listed in the file. 3948352Scael.Pp 4048352ScaelThe 4148352Scael.Fn getusershell 4248352Scaelfunction 4325431Smckusickreads the next 4425431Smckusickline (opening the file if necessary); 4548352Scael.Fn setusershell 4625431Smckusickrewinds the file; 4748352Scael.Fn endusershell 4825431Smckusickcloses it. 4948352Scael.Sh FILES 5048352Scael.Bl -tag -width /etc/shells -compact 5148352Scael.It Pa /etc/shells 5248352Scael.El 5348352Scael.Sh DIAGNOSTICS 5425431SmckusickThe routine 5548352Scael.Fn getusershell 5648352Scaelreturns a null pointer (0) on 5748352Scael.Dv EOF . 5848352Scael.Sh SEE ALSO 5948352Scael.Xr shells 5 6048352Scael.Sh HISTORY 6148352ScaelThe 6248352Scael.Fn getusershell 6348352Scaelfunction appeared in 6448352Scael.Bx 4.3 . 6548352Scael.Sh BUGS 6648352ScaelThe 6748352Scael.Fn getusershell 6848352Scaelfunction leaves its result in an internal static object and returns 6948352Scaela pointer to that object. Subsequent calls to 7048352Scael.Fn getusershell 7148352Scaelwill modify the same object. 72