\Header{Sys.info}{Extract System and User Information}
\keyword{utilities}{Sys.info}
\begin{Description}\relax
Reports system and user information.
\end{Description}
\begin{Usage}
\begin{verbatim}
Sys.info()
\end{verbatim}
\end{Usage}
\begin{Details}\relax
This function is not implemented on all \R{} platforms, and returns
\code{NULL} when not available.  Where possible it is based on POSIX
system calls.

\code{Sys.info()} returns details of the platform \R{} is running on,
whereas \code{\Link{R.version}} gives details of the platform \R{} was
built on: they may well be different.
\end{Details}
\begin{Value}
A character vector with fields
\begin{ldescription}
\item[\code{sysname}] The operating system.
\item[\code{release}] The OS release.
\item[\code{version}] The OS version.
\item[\code{nodename}] A name by which the machine is known on the network (if
any).
\item[\code{machine}] A concise description of the hardware.
\item[\code{login}] The user's login name, or \code{"unknown"} if it cannot be
ascertained.
\item[\code{user}] The name of the real user ID, or \code{"unknown"} if it
cannot be ascertained.
\end{ldescription}

The first five fields come from the \code{uname(2)} system call.  The
login name comes from \code{getlogin(2)}, and the user name from
\code{getpwuid(getuid())}
\end{Value}
\begin{Note}\relax
The meaning of OS \dQuote{release} and \dQuote{version} is highly
system-dependent and there is no guarantee that the node or
login or user names will be what you might reasonably expect.
(In particular on some Linux distributions the login name is unknown
from sessions with re-directed inputs.)
\end{Note}
\begin{SeeAlso}\relax
\code{\Link{.Platform}}, and \code{\Link{R.version}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
Sys.info()
## An alternative (and probably better) way to get the login name on Unix
Sys.getenv("LOGNAME")
\end{ExampleCode}
\end{Examples}

