posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
POSIX_SINGLE_PROCESS

POSIX Single Process option group. More...

Files

file  confstr.h
 POSIX configuration string constants (<sys/confstr.h>)
 
file  sysconf.h
 POSIX runtime system configuration (<sys/sysconf.h>)
 
file  utsname.h
 POSIX system name identification (<sys/utsname.h>)
 

Functions

int setenv (const char *envname, const char *envval, int overwrite)
 Set the value of an environment variable.
 
int unsetenv (const char *name)
 Remove an environment variable.
 
int uname (struct utsname *name)
 Get the name of the current system.
 
size_t confstr (int name, char *buf, size_t len)
 Determine the value of a configurable system variable by name string.
 
int getentropy (void *buffer, size_t length)
 Fill a buffer with cryptographically secure random bytes.
 
int gethostname (char *name, size_t namelen)
 Get the name of the current host.
 
long sysconf (int opt)
 Get a configurable system variable.
 

Detailed Description

POSIX Single Process option group.

Covers confstr(), sysconf(), gethostname(), getentropy(), and related single-process environment functions.

Function Documentation

◆ confstr()

size_t confstr ( int  name,
char *  buf,
size_t  len 
)

Determine the value of a configurable system variable by name string.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/confstr.html

◆ getentropy()

int getentropy ( void *  buffer,
size_t  length 
)

Fill a buffer with cryptographically secure random bytes.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getentropy.html

◆ gethostname()

int gethostname ( char *  name,
size_t  namelen 
)

◆ setenv()

int setenv ( const char *  envname,
const char *  envval,
int  overwrite 
)

Set the value of an environment variable.

Parameters
envnameName of the variable (must not contain '=').
envvalNew value string.
overwriteNon-zero to overwrite an existing value; 0 to preserve it.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/setenv.html

◆ sysconf()

long sysconf ( int  opt)

◆ uname()

int uname ( struct utsname name)

Get the name of the current system.

Parameters
nameOutput: system identification structure to fill in.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/uname.html

◆ unsetenv()

int unsetenv ( const char *  name)

Remove an environment variable.

Parameters
nameName of the variable to remove.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/unsetenv.html