Posix.SysDB
structure
signature POSIX_SYS_DB
structure SysDB
: POSIX_SYS_DB
The Posix.SysDB
structure implements operations on the user database and the group database (in POSIX parlance, the password file and the group file). These are the data and operations described in Section 9 of the POSIX standard 1003.1,1996[CITE].
eqtype uid
eqtype gid
structure Passwd : sig
type passwd
val name : passwd -> string
val uid : passwd -> uid
val gid : passwd -> gid
val home : passwd -> string
val shell : passwd -> string
end
structure Group : sig
type group
val name : group -> string
val gid : group -> gid
val members : group -> string list
end
val getgrgid : gid -> Group.group
val getgrnam : string -> Group.group
val getpwuid : uid -> Passwd.passwd
val getpwnam : string -> Passwd.passwd
eqtype uid
Posix.ProcEnv.uid
.
eqtype gid
Posix.ProcEnv.gid
.
structure Passwd
type passwd
val name : passwd -> string
val uid : passwd -> uid
val gid : passwd -> gid
val home : passwd -> string
val shell : passwd -> string
passwd
value. The names of the corresponding fields in C are the same, but prefixed with "pw_"
. The one exception is that C uses pw_dir
for the home directory.
structure Group
type group
val name : group -> string
val gid : group -> gid
val members : group -> string list
group
value. In C, these fields are named gr_name
, gr_gid
, and gr_mem
, respectively.
val getgrgid : gid -> Group.group
val getgrnam : string -> Group.group
val getpwuid : uid -> Passwd.passwd
val getpwnam : string -> Passwd.passwd
OS.SysErr
if there is no group or user with the given ID or name.
Posix
Generated October 02, 2003
Last Modified July 1, 2002
Comments to John Reppy.
This document may be distributed freely over the internet as long as the copyright notice and license terms below are prominently displayed within every machine-readable copy.
Copyright © 2003 AT&T and Lucent Technologies. All rights reserved.
Permission is granted for internet users to make one paper copy for their
own personal use. Further hardcopy reproduction is strictly prohibited.
Permission to distribute the HTML document electronically on any medium
other than the internet must be requested from the copyright holders by
contacting the editors.
Printed versions of the SML Basis Manual are available from Cambridge
University Press.
To order, please visit
www.cup.org (North America) or
www.cup.cam.ac.uk (outside North America). |