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

XSI Single Process option group. More...

Files

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

Macros

#define F_LOCK   1
 Lock a region of a file (lockf command).
 
#define F_TEST   3
 Test whether a file region is locked (lockf command).
 
#define F_TLOCK   2
 Lock a region, failing immediately if blocked (lockf command).
 
#define F_ULOCK   0
 Unlock a region (lockf command).
 

Functions

int putenv (char *string)
 Add or change an environment variable (XSI extension).
 
struct tm * getdate (const char *string)
 Convert a date-time string to broken-down time (XSI extension).
 
char * strptime (const char *ZRESTRICT s, const char *ZRESTRICT format, struct tm *ZRESTRICT tm)
 Parse a date/time string according to a format (XSI extension).
 
int mknod (const char *path, mode_t mode, dev_t dev)
 Create a special or regular file (XSI extension).
 
int mknodat (int fd, const char *path, mode_t mode, dev_t dev)
 Create a special or regular file relative to a directory descriptor (XSI).
 
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).
 
int lockf (int fildes, int function, off_t size)
 Apply, test, or remove an advisory file lock (XSI extension).
 
int setregid (gid_t rgid, gid_t egid)
 Set the real and effective group IDs (XSI extension).
 
int setreuid (uid_t ruid, uid_t euid)
 Set the real and effective user IDs (XSI extension).
 
void swab (const void *ZRESTRICT src, void *ZRESTRICT dest, ssize_t nbytes)
 Swap bytes in a block of memory (XSI extension).
 
void sync (void)
 Schedule outstanding writes to all file systems (XSI extension).
 

Variables

int daylight
 Non-zero if Daylight Saving Time is in effect.
 
long timezone
 Offset in seconds from UTC for the current timezone.
 

Detailed Description

XSI Single Process option group.

Covers gethostid(), crypt(), encrypt(), setregid(), setreuid(), nice(), sync(), swab(), lockf(), and other XSI-mandatory single-process functions.

Macro Definition Documentation

◆ F_LOCK

#define F_LOCK   1

Lock a region of a file (lockf command).

Definition at line 91 of file unistd.h.

◆ F_TEST

#define F_TEST   3

Test whether a file region is locked (lockf command).

Definition at line 93 of file unistd.h.

◆ F_TLOCK

#define F_TLOCK   2

Lock a region, failing immediately if blocked (lockf command).

Definition at line 95 of file unistd.h.

◆ F_ULOCK

#define F_ULOCK   0

Unlock a region (lockf command).

Definition at line 97 of file unistd.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

◆ 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

◆ getdate()

struct tm * getdate ( const char *  string)

Convert a date-time string to broken-down time (XSI extension).

Parameters
stringDate-time string; the format is determined by the DATEMSK environment variable.
Returns
Pointer to a broken-down time, or NULL on failure.

◆ gethostid()

long gethostid ( void  )

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 
)

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

◆ lockf()

int lockf ( int  fildes,
int  function,
off_t  size 
)

Apply, test, or remove an advisory file lock (XSI extension).

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

◆ mknod()

int mknod ( const char *  path,
mode_t  mode,
dev_t  dev 
)

Create a special or regular file (XSI extension).

◆ mknodat()

int mknodat ( int  fd,
const char *  path,
mode_t  mode,
dev_t  dev 
)

Create a special or regular file relative to a directory descriptor (XSI).

◆ putenv()

int putenv ( char *  string)

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

◆ setregid()

int setregid ( gid_t  rgid,
gid_t  egid 
)

Set the real and effective group IDs (XSI extension).

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

◆ setreuid()

int setreuid ( uid_t  ruid,
uid_t  euid 
)

Set the real and effective user IDs (XSI extension).

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

◆ strptime()

char * strptime ( const char *ZRESTRICT  s,
const char *ZRESTRICT  format,
struct tm *ZRESTRICT  tm 
)

Parse a date/time string according to a format (XSI extension).

Parameters
sInput string to parse.
formatFormat string describing the date/time fields to parse.
tmOutput: filled-in broken-down time structure.
Returns
Pointer to the first character in s not consumed by parsing, or NULL on failure.
See also
https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html

◆ swab()

void swab ( const void *ZRESTRICT  src,
void *ZRESTRICT  dest,
ssize_t  nbytes 
)

Swap bytes in a block of memory (XSI extension).

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

◆ sync()

void sync ( void  )

Schedule outstanding writes to all file systems (XSI extension).

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

Variable Documentation

◆ daylight

int daylight
extern

Non-zero if Daylight Saving Time is in effect.

◆ timezone

long timezone
extern

Offset in seconds from UTC for the current timezone.