posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
XSI_SINGLE_PROCESS
Implementation completeness: 100.0%100IMPLLine coverage: 91.2%91COV

XSI Single Process option group. More...

Files

file  time.h
 POSIX time-of-day types and functions (<sys/time.h>)
 

Macros

#define P_tmpdir   "/tmp"
 Pathname of the directory for temporary files.
 

Functions

char * ctermid (char *s)
 Maximum number of streams that one process can have open at one time.
 
int pclose (FILE *stream)
 Close a pipe stream.
 
FILE * popen (const char *command, const char *type)
 Create a pipe to a process.
 
char * tempnam (const char *dir, const char *pfx)
 Generate a pathname for a temporary file (obsolescent).
 
int putenv (char *string)
 Add or change an environment variable (XSI extension).
 
int gettimeofday (struct timeval *tv, void *tz)
 Get the current time with microsecond resolution.
 
char * crypt (const char *key, const char *salt)
 Encrypt a password string (XSI extension, not recommended for new code).
 
void encrypt (char block[64], int edflag)
 Encrypt or decrypt a 64-bit block using DES (XSI extension).
 
long gethostid (void)
 Get a unique identifier for the host system (XSI extension).
 

Detailed Description

XSI Single Process option group.

Covers gethostid(), gettimeofday(), putenv(), and related XSI-mandatory single-process functions.

Macro Definition Documentation

◆ P_tmpdir

#define P_tmpdir   "/tmp"

Pathname of the directory for temporary files.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdio.h.html

Definition at line 67 of file posix_stdio.h.

Function Documentation

◆ crypt()

char * crypt ( const char *  key,
const char *  salt 
)

Encrypt a password string (XSI extension, not recommended for new code).

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

◆ ctermid()

char * ctermid ( char *  s)

Maximum number of streams that one process can have open at one time.

See also
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdio.h.html

Generate a pathname for the controlling terminal.

Parameters
sOptional buffer of at least L_ctermid bytes, or NULL.
Returns
Pathname of the controlling terminal, or NULL on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctermid.html

◆ encrypt()

void encrypt ( char  block[64],
int  edflag 
)

Encrypt or decrypt a 64-bit block using DES (XSI extension).

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

◆ gethostid()

long gethostid ( void  )
gethostid line coverage: 80.0%80

Get a unique identifier for the host system (XSI extension).

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

◆ gettimeofday()

int gettimeofday ( struct timeval tv,
void *  tz 
)
gettimeofday line coverage: 66.7%67

Get the current time with microsecond resolution.

Parameters
tvOutput: current time; tv_sec is seconds and tv_usec is microseconds since the Epoch.
tzDeprecated, must be NULL.
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html

◆ pclose()

int pclose ( FILE *  stream)

Close a pipe stream.

Parameters
streamStream returned by popen().
Returns
Termination status of the command, or -1 on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pclose.html

◆ popen()

FILE * popen ( const char *  command,
const char *  type 
)

Create a pipe to a process.

Parameters
commandShell command to execute.
type"r" to read from the command, or "w" to write to it.
Returns
Pointer to the stream, or NULL on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/popen.html

◆ putenv()

int putenv ( char *  string)
putenv line coverage: 100.0%100

Add or change an environment variable (XSI extension).

string must be of the form "NAME=value". The string is placed directly in the environment, so it must remain valid for the lifetime of the process.

Parameters
stringEnvironment entry of the form "NAME=value".
Returns
0 on success, or -1 with errno set on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/putenv.html

◆ tempnam()

char * tempnam ( const char *  dir,
const char *  pfx 
)

Generate a pathname for a temporary file (obsolescent).

Parameters
dirDirectory prefix, or NULL to use P_tmpdir.
pfxFilename prefix, or NULL.
Returns
Pointer to a pathname, or NULL on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/tempnam.html