Gromacs  2024.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
sysinfo.cpp File Reference
#include "gmxpre.h"
#include "gromacs/utility/sysinfo.h"
#include "config.h"
#include <cstring>
#include <ctime>
#include <array>
#include <sys/types.h>
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/gmxassert.h"
+ Include dependency graph for sysinfo.cpp:

Description

Implements functions from sysinfo.h.

Author
Teemu Murtola teemu.nosp@m..mur.nosp@m.tola@.nosp@m.gmai.nosp@m.l.com

Functions

int gmx_gethostname (char *buf, size_t len)
 Gets the hostname as given by gethostname(), if available. More...
 
int gmx_getpid ()
 Returns the process ID of the current process. More...
 
int gmx_getuid ()
 Returns the current user ID, or -1 if not available. More...
 
int gmx_getusername (char *buf, size_t len)
 Gets the current user name, if available. More...
 
std::string gmx_ctime_r (const time_t *clock)
 Portable version of ctime_r. More...
 
std::string gmx_format_current_time ()
 Gets the current time as a string. More...
 
int gmx_set_nice (int level)
 Wrapper for nice(). More...
 

Variables

const char anonymous_namespace{sysinfo.cpp}::c_unknown [] = "unknown"
 Static return value for cases when a string value is not available.