Posix.ProcEnv
structure
signature POSIX_PROC_ENV
structure ProcEnv
: POSIX_PROC_ENV
The structure Posix.ProcEnv
specifies functions, as described in Section 4 of the POSIX standard 1003.1,1996[CITE], which provide primitive POSIX access to the process environment.
eqtype pid
eqtype uid
eqtype gid
eqtype file_desc
val uidToWord : uid -> SysWord.word
val wordToUid : SysWord.word -> uid
val gidToWord : gid -> SysWord.word
val wordToGid : SysWord.word -> gid
val getpid : unit -> pid
val getppid : unit -> pid
val getuid : unit -> uid
val geteuid : unit -> uid
val getgid : unit -> gid
val getegid : unit -> gid
val setuid : uid -> unit
val setgid : gid -> unit
val getgroups : unit -> gid list
val getlogin : unit -> string
val getpgrp : unit -> pid
val setsid : unit -> pid
val setpgid : {pid : pid option, pgid : pid option} -> unit
val uname : unit -> (string * string) list
val time : unit -> Time.time
val times : unit
-> {
elapsed : Time.time,
utime : Time.time,
stime : Time.time,
cutime : Time.time,
cstime : Time.time
}
val getenv : string -> string option
val environ : unit -> string list
val ctermid : unit -> string
val ttyname : file_desc -> string
val isatty : file_desc -> bool
val sysconf : string -> SysWord.word
eqtype pid
eqtype uid
eqtype gid
eqtype file_desc
val uidToWord : uid -> SysWord.word
val wordToUid : SysWord.word -> uid
wordToUid
does not ensure that it returns a valid uid
.
val gidToWord : gid -> SysWord.word
val wordToGid : SysWord.word -> gid
wordToGid
does not ensure that it returns a valid gid
.
val getpid : unit -> pid
val getppid : unit -> pid
val getuid : unit -> uid
val geteuid : unit -> uid
val getgid : unit -> gid
val getegid : unit -> gid
setuid u
setgid g
val getgroups : unit -> gid list
val getlogin : unit -> string
val getpgrp : unit -> pid
val setsid : unit -> pid
setpgid (SOME pid, SOME pgid)
setpgid (NONE, SOME pgid)
setpgid (SOME pid, NONE)
setpgid (NONE, NONE)
val uname : unit -> (string * string) list
"sysname"
, "nodename"
, "release"
, "version"
, and "machine"
. (A POSIX implementation may provide additional values beyond this set.) The respective values are strings that describe the named system component.
val time : unit -> Time.time
val times : unit
-> {
elapsed : Time.time,
utime : Time.time,
stime : Time.time,
cutime : Time.time,
cstime : Time.time
}
elapsed
), user time (utime
), system time (stime
), user CPU time of terminated child processes (cutime
), and system CPU time of terminated child processes (cstime
), for the calling process.
getenv name
name=value
and returns SOME
(value)
if name
is present; it returns NONE
if name
is not present. This is equivalent to OS.Process.getEnv
.
val environ : unit -> string list
val ctermid : unit -> string
ttyname fd
OS.SysErr
if fd does not denote a valid terminal device.
isatty fd
true
if fd is a valid file descriptor associated with a terminal. Note that isatty
will return false
if fd is a bad file descriptor.
sysconf s
OS.SysErr
if s does not denote a supported POSIX system variable.
The properties required by POSIX are described below. This list is a minimal set required for POSIX compliance, and an implementation may extend it with additional properties.
"ARG_MAX"
Posix.Process.exec
, Posix.Process.exece
, and Posix.Process.execp
. This also applies to environment data.
"CHILD_MAX"
"CLK_TCK"
"NGROUPS_MAX"
"OPEN_MAX"
"STREAM_MAX"
"TZNAME_MAX"
"JOB_CONTROL"
"SAVED_IDS"
"VERSION"
"_SC_"
.
Posix
,Posix.FileSys
,Posix.ProcEnv
,Time
Generated April 12, 2004
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 © 2004 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). |