| Line 28... |
Line 28... |
| 28 |
\item{effective_user}{The name of the effective user ID, or
|
28 |
\item{effective_user}{The name of the effective user ID, or
|
| 29 |
\code{"unknown"} if it
|
29 |
\code{"unknown"} if it
|
| 30 |
cannot be ascertained. This may differ from the real user in
|
30 |
cannot be ascertained. This may differ from the real user in
|
| 31 |
\sQuote{set-user-ID} processes.}
|
31 |
\sQuote{set-user-ID} processes.}
|
| 32 |
#ifdef unix
|
32 |
#ifdef unix
|
| 33 |
|
33 |
|
| 34 |
The first five fields come from the \code{uname(2)} system call. The
|
34 |
The first five fields come from the \code{uname(2)} system call. The
|
| 35 |
login name comes from \code{getlogin(2)}, and the user names from
|
35 |
login name comes from \code{getlogin(2)}, and the user names from
|
| 36 |
\code{getpwuid(getuid())} and \code{getpwuid(geteuid())}
|
36 |
\code{getpwuid(getuid())} and \code{getpwuid(geteuid())}
|
| 37 |
#endif
|
37 |
#endif
|
| 38 |
}
|
38 |
}
|
| Line 50... |
Line 50... |
| 50 |
The meaning of OS \sQuote{release} and \sQuote{version} is
|
50 |
The meaning of OS \sQuote{release} and \sQuote{version} is
|
| 51 |
system-dependent and there is no guarantee that the node or
|
51 |
system-dependent and there is no guarantee that the node or
|
| 52 |
login or user names will be what you might reasonably expect.
|
52 |
login or user names will be what you might reasonably expect.
|
| 53 |
(In particular on some Linux distributions the login name is unknown
|
53 |
(In particular on some Linux distributions the login name is unknown
|
| 54 |
from sessions with re-directed inputs.)
|
54 |
from sessions with re-directed inputs.)
|
| 55 |
|
55 |
|
| 56 |
The use of alternatives such as \code{system("whoami")} is not
|
56 |
The use of alternatives such as \code{system("whoami")} is not
|
| 57 |
portable: the POSIX command \code{system("id")} is much more portable
|
57 |
portable: the POSIX command \code{system("id")} is much more portable
|
| 58 |
on Unix-alikes, provided only the POSIX options are used (and not the
|
58 |
on Unix-alikes, provided only the POSIX options are used (and not the
|
| 59 |
many GNU extensions).
|
59 |
many GNU extensions).
|
| 60 |
}
|
60 |
}
|