The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
unistd.h File Reference

This file contains the declarations of POSIX-like system call wrappers. More...

#include <sys/types.h>
#include <fcntl.h>
#include <sys/wait.h>
#include "syscall.h"

Go to the source code of this file.

Data Structures

struct  key_event_t
 keyboard event structure (matches kernel keyboard_event_t). More...

Macros

#define STDIN_FILENO   0
#define STDOUT_FILENO   1
#define STDERR_FILENO   2
#define F_OK   0
#define X_OK   1
#define W_OK   2
#define R_OK   4
#define TTY_COOKED   0
#define TTY_RAW   1
#define CONSOLE_KEY_EVENT_CHAR   0
#define CONSOLE_KEY_EVENT_SPECIAL   1
#define CONSOLE_KEY_EVENT_RAW   2
#define CONSOLE_KEY_UP   1
#define CONSOLE_KEY_DOWN   2
#define CONSOLE_KEY_LEFT   3
#define CONSOLE_KEY_RIGHT   4
#define CONSOLE_KEY_HOME   5
#define CONSOLE_KEY_END   6
#define CONSOLE_KEY_PAGE_UP   7
#define CONSOLE_KEY_PAGE_DOWN   8
#define CONSOLE_KEY_INSERT   9
#define CONSOLE_KEY_DELETE   10
#define SEEK_SET   0
#define SEEK_CUR   1
#define SEEK_END   2
#define _SC_ARG_MAX   0
#define _SC_CHILD_MAX   1
#define _SC_CLK_TCK   2
#define _SC_OPEN_MAX   4
#define _SC_PAGESIZE   30
#define _SC_PAGE_SIZE   _SC_PAGESIZE
#define _SC_NPROCESSORS_CONF   83
#define _SC_NPROCESSORS_ONLN   84
#define _SC_LINE_MAX   43
#define _SC_HOST_NAME_MAX   180
#define _SC_LOGIN_NAME_MAX   71
#define _SC_PHYS_PAGES   85
#define _PC_LINK_MAX   0
#define _PC_MAX_CANON   1
#define _PC_MAX_INPUT   2
#define _PC_NAME_MAX   3
#define _PC_PATH_MAX   4
#define _PC_PIPE_BUF   5
#define _PC_CHOWN_RESTRICTED   6
#define _PC_NO_TRUNC   7
#define _PC_VDISABLE   8
#define _CS_PATH   0

Functions

ssize_t write (int fd, const void *buf, size_t count)
 write bytes to a file descriptor.
ssize_t read (int fd, void *buf, size_t count)
 read bytes from a file descriptor.
int close (int fd)
 close a file descriptor.
pid_t exec (const char *path, const char **argv)
 execute a program, spawning a child process.
pid_t fork (void)
 create a child process that is a copy of the caller.
int execve (const char *path, char *const argv[], char *const envp[])
 replace the calling process's program.
int execv (const char *path, char *const argv[])
 execve with the environment of the calling process.
int execvp (const char *file, char *const argv[])
 execv, but a file name with no '/' is looked for in the directories of PATH (/bin when PATH is not set).
int execl (const char *path, const char *arg,...)
 execv, execvp and execve with the arguments as a list that ends with NULL.
int execlp (const char *file, const char *arg,...)
int execle (const char *path, const char *arg,...)
void _exit (int status) __attribute__((noreturn))
 terminate the current process.
int dup (int fd)
 duplicate a descriptor to the lowest free one; both share the open file.
int access (const char *path, int mode)
 check that a file exists and may be accessed.
int faccessat (int dirfd, const char *path, int mode, int flags)
ssize_t pread (int fd, void *buf, size_t count, off_t offset)
 read or write at an offset, without moving the file offset.
ssize_t pwrite (int fd, const void *buf, size_t count, off_t offset)
int fsync (int fd)
 write an open file's data to disk.
unsigned int alarm (unsigned int seconds)
 send SIGALRM to the calling process after a number of seconds.
int pause (void)
 sleep until a signal is caught.
unsigned int sleep (unsigned int seconds)
 sleep for a number of seconds (or microseconds).
int usleep (unsigned int microseconds)
int setpgid (pid_t pid, pid_t pgid)
 process groups and sessions (job control).
pid_t getpgid (pid_t pid)
pid_t getpgrp (void)
pid_t setsid (void)
int nice (int increment)
 add increment to the caller's nice value (see sys/resource.h).
int chroot (const char *path)
 make a directory the root of the caller's paths ("/" is then that directory; root only).
pid_t getsid (pid_t pid)
uid_t getuid (void)
 user and group ids: real (who started the process) and effective (what it may do).
uid_t geteuid (void)
gid_t getgid (void)
gid_t getegid (void)
int setuid (uid_t uid)
int setgid (gid_t gid)
int seteuid (uid_t uid)
int setegid (gid_t gid)
int chown (const char *path, uid_t uid, gid_t gid)
 change the owner of a file.
int fchown (int fd, uid_t uid, gid_t gid)
int lchown (const char *path, uid_t uid, gid_t gid)
int fchownat (int dirfd, const char *path, uid_t uid, gid_t gid, int flags)
pid_t getppid (void)
 get the parent's process ID.
int sched_yield (void)
 let other ready processes run before this one continues.
pid_t getpid (void)
 get the current process ID.
void * sbrk (int increment)
 grow the program break (allocate heap memory).
char * getcwd (char *buf, size_t size)
 get the current working directory.
int chdir (const char *path)
 change the current working directory.
int unlink (const char *path)
 remove (unlink) a file.
int symlink (const char *target, const char *path)
 make a symbolic link at path that points at target
int symlinkat (const char *target, int dirfd, const char *path)
ssize_t readlink (const char *restrict path, char *restrict buffer, size_t size)
 read a symbolic link's target (no NUL; a longer target is cut).
ssize_t readlinkat (int dirfd, const char *restrict path, char *restrict buffer, size_t size)
int link (const char *old_path, const char *new_path)
 give a file one more name (a hard link)
int linkat (int old_dirfd, const char *old_path, int new_dirfd, const char *new_path, int flags)
int unlinkat (int dirfd, const char *path, int flags)
 remove a file, or with AT_REMOVEDIR a directory, relative to dirfd
int rmdir (const char *path)
 remove a directory.
int create (const char *path)
 create a file, or truncate it if it exists (the file is not left open).
int ttyctl (int mode)
 switch the terminal on fd 0 between two modes (a wrapper over termios): TTY_COOKED is line input with echo and signal keys; TTY_RAW gives one key_event_t per read (read_event), with no echo and Ctrl+C as a key.
char * getpass (const char *prompt)
 ask for a password on the terminal (standard input), without echo.
int isatty (int fd)
 true if fd refers to a terminal.
int ioctl (int fd, unsigned int request, void *arg)
 issue a device-control request on an open file descriptor.
int read_event (key_event_t *event)
 read a single keyboard event from stdin (raw mode).
int pipe (int fds[2])
 create a pipe (pair of connected file descriptors).
int dup2 (int old_fd, int new_fd)
 duplicate a file descriptor to a specific number.
int ftruncate (int fd, off_t length)
 cut or grow a file to length bytes (the new bytes read as zeros).
int truncate (const char *path, off_t length)
off_t lseek (int fd, off_t offset, int whence)
 set file cursor position.
long sysconf (int name)
 a limit of the system (a SC name), or -1 with EINVAL
long pathconf (const char *path, int name)
 a limit of the files at path (a PC name).
long fpathconf (int fd, int name)
size_t confstr (int name, char *buffer, size_t size)
 a string value of the system (a CS name) into buffer.
int gethostname (char *name, size_t length)
 the name of this computer (uname's nodename) into name
int sethostname (const char *name, size_t length)
 set the host name (root only; at most 64 bytes)
char * ttyname (int fd)
 the name of the terminal open as fd (as "/dev/pts/0").
int ttyname_r (int fd, char *buffer, size_t size)
void sync (void)
 make every write reach the disk.
int daemon (int keep_dir, int keep_files)
 go on in the background: a new process in a new session, with no terminal.
int getopt (int argc, char *const argv[], const char *options)
 the next option of a command line (POSIX getopt).
int getentropy (void *buf, size_t length)
 fill buf with length random bytes (at most 256) from the kernel.
char * getlogin (void)
 the name of the user who runs the program (from the password file), or NULL

Variables

char * optarg
int optind
int opterr
int optopt

Detailed Description

This file contains the declarations of POSIX-like system call wrappers.

Macro Definition Documentation

◆ STDIN_FILENO

#define STDIN_FILENO   0

◆ STDOUT_FILENO

#define STDOUT_FILENO   1

◆ STDERR_FILENO

#define STDERR_FILENO   2

◆ F_OK

#define F_OK   0

◆ X_OK

#define X_OK   1

◆ W_OK

#define W_OK   2

◆ R_OK

#define R_OK   4

◆ TTY_COOKED

#define TTY_COOKED   0

◆ TTY_RAW

#define TTY_RAW   1

◆ CONSOLE_KEY_EVENT_CHAR

#define CONSOLE_KEY_EVENT_CHAR   0

◆ CONSOLE_KEY_EVENT_SPECIAL

#define CONSOLE_KEY_EVENT_SPECIAL   1

◆ CONSOLE_KEY_EVENT_RAW

#define CONSOLE_KEY_EVENT_RAW   2

◆ CONSOLE_KEY_UP

#define CONSOLE_KEY_UP   1

◆ CONSOLE_KEY_DOWN

#define CONSOLE_KEY_DOWN   2

◆ CONSOLE_KEY_LEFT

#define CONSOLE_KEY_LEFT   3

◆ CONSOLE_KEY_RIGHT

#define CONSOLE_KEY_RIGHT   4

◆ CONSOLE_KEY_HOME

#define CONSOLE_KEY_HOME   5

◆ CONSOLE_KEY_END

#define CONSOLE_KEY_END   6

◆ CONSOLE_KEY_PAGE_UP

#define CONSOLE_KEY_PAGE_UP   7

◆ CONSOLE_KEY_PAGE_DOWN

#define CONSOLE_KEY_PAGE_DOWN   8

◆ CONSOLE_KEY_INSERT

#define CONSOLE_KEY_INSERT   9

◆ CONSOLE_KEY_DELETE

#define CONSOLE_KEY_DELETE   10

◆ SEEK_SET

#define SEEK_SET   0

◆ SEEK_CUR

#define SEEK_CUR   1

◆ SEEK_END

#define SEEK_END   2

◆ _SC_ARG_MAX

#define _SC_ARG_MAX   0

◆ _SC_CHILD_MAX

#define _SC_CHILD_MAX   1

◆ _SC_CLK_TCK

#define _SC_CLK_TCK   2

◆ _SC_OPEN_MAX

#define _SC_OPEN_MAX   4

◆ _SC_PAGESIZE

#define _SC_PAGESIZE   30

◆ _SC_PAGE_SIZE

#define _SC_PAGE_SIZE   _SC_PAGESIZE

◆ _SC_NPROCESSORS_CONF

#define _SC_NPROCESSORS_CONF   83

◆ _SC_NPROCESSORS_ONLN

#define _SC_NPROCESSORS_ONLN   84

◆ _SC_LINE_MAX

#define _SC_LINE_MAX   43

◆ _SC_HOST_NAME_MAX

#define _SC_HOST_NAME_MAX   180

◆ _SC_LOGIN_NAME_MAX

#define _SC_LOGIN_NAME_MAX   71

◆ _SC_PHYS_PAGES

#define _SC_PHYS_PAGES   85

◆ _PC_LINK_MAX

#define _PC_LINK_MAX   0

◆ _PC_MAX_CANON

#define _PC_MAX_CANON   1

◆ _PC_MAX_INPUT

#define _PC_MAX_INPUT   2

◆ _PC_NAME_MAX

#define _PC_NAME_MAX   3

◆ _PC_PATH_MAX

#define _PC_PATH_MAX   4

◆ _PC_PIPE_BUF

#define _PC_PIPE_BUF   5

◆ _PC_CHOWN_RESTRICTED

#define _PC_CHOWN_RESTRICTED   6

◆ _PC_NO_TRUNC

#define _PC_NO_TRUNC   7

◆ _PC_VDISABLE

#define _PC_VDISABLE   8

◆ _CS_PATH

#define _CS_PATH   0

Function Documentation

◆ write()

ssize_t write ( int fd,
const void * buf,
size_t count )

write bytes to a file descriptor.

Parameters
fdfile descriptor (1 = stdout, 2 = stderr).
bufpointer to data to write.
countnumber of bytes to write.
Returns
number of bytes written, or -1 on error.

◆ read()

ssize_t read ( int fd,
void * buf,
size_t count )

read bytes from a file descriptor.

Parameters
fdfile descriptor (0 = stdin).
bufbuffer to read into.
countmaximum bytes to read.
Returns
number of bytes read, or -1 on error.

◆ close()

int close ( int fd)

close a file descriptor.

Parameters
fdfile descriptor to close.
Returns
0 on success, -1 on failure.

◆ exec()

pid_t exec ( const char * path,
const char ** argv )

execute a program, spawning a child process.

Parameters
pathpath to the ELF executable.
argvnull-terminated array of argument strings (may be NULL).
Returns
child PID on success, -1 on failure.

◆ fork()

pid_t fork ( void )

create a child process that is a copy of the caller.

the two share nothing after the call: memory is copied (lazily, on the first write), and the child gets its own copy of every fd.

Returns
the child's PID in the parent, 0 in the child, -1 on failure (errno set).

◆ execve()

int execve ( const char * path,
char *const argv[],
char *const envp[] )

replace the calling process's program.

the pid, cwd and open fds stay.

Parameters
pathpath to the ELF executable.
argvNULL-terminated argument strings.
envpNULL-terminated "KEY=VALUE" environment strings.
Returns
only on failure: -1 (errno set).

◆ execv()

int execv ( const char * path,
char *const argv[] )

execve with the environment of the calling process.

Returns
only on failure: -1 (errno set).

◆ execvp()

int execvp ( const char * file,
char *const argv[] )

execv, but a file name with no '/' is looked for in the directories of PATH (/bin when PATH is not set).

Returns
only on failure: -1 (errno set).

◆ execl()

int execl ( const char * path,
const char * arg,
... )

execv, execvp and execve with the arguments as a list that ends with NULL.

execle takes the environment after the NULL.

Returns
only on failure: -1 (errno set).

◆ execlp()

int execlp ( const char * file,
const char * arg,
... )

◆ execle()

int execle ( const char * path,
const char * arg,
... )

◆ _exit()

void _exit ( int status)

terminate the current process.

Parameters
statusexit code.

◆ dup()

int dup ( int fd)

duplicate a descriptor to the lowest free one; both share the open file.

Returns
the new descriptor, or -1 (errno set).

◆ access()

int access ( const char * path,
int mode )

check that a file exists and may be accessed.

there are no users yet, so every existing file allows every access.

Parameters
paththe file.
modeF_OK, or R_OK | W_OK | X_OK.
Returns
0, or -1 (errno set).

◆ faccessat()

int faccessat ( int dirfd,
const char * path,
int mode,
int flags )

◆ pread()

ssize_t pread ( int fd,
void * buf,
size_t count,
off_t offset )

read or write at an offset, without moving the file offset.

Returns
bytes transferred, or -1 (errno set; ESPIPE for a pipe).

◆ pwrite()

ssize_t pwrite ( int fd,
const void * buf,
size_t count,
off_t offset )

◆ fsync()

int fsync ( int fd)

write an open file's data to disk.

Returns
0, or -1 (errno set).

◆ alarm()

unsigned int alarm ( unsigned int seconds)

send SIGALRM to the calling process after a number of seconds.

Parameters
seconds0 cancels the alarm.
Returns
the seconds left of the previous alarm, or 0.

◆ pause()

int pause ( void )

sleep until a signal is caught.

always returns -1 with EINTR.

◆ sleep()

unsigned int sleep ( unsigned int seconds)

sleep for a number of seconds (or microseconds).

Returns
sleep: the seconds left if a signal ended it early, else 0. usleep: 0, or -1 (errno set).

◆ usleep()

int usleep ( unsigned int microseconds)

◆ setpgid()

int setpgid ( pid_t pid,
pid_t pgid )

process groups and sessions (job control).

setpgid(pid, pgid): pid 0 is the caller, pgid 0 makes a new group led by pid. getpgrp() is getpgid(0). setsid() starts a session and returns its id.

Returns
as named, or -1 (errno set).

◆ getpgid()

pid_t getpgid ( pid_t pid)

◆ getpgrp()

pid_t getpgrp ( void )

◆ setsid()

pid_t setsid ( void )

◆ nice()

int nice ( int increment)

add increment to the caller's nice value (see sys/resource.h).

Returns
the new value, or -1 (errno set).

◆ chroot()

int chroot ( const char * path)

make a directory the root of the caller's paths ("/" is then that directory; root only).

the working directory stays: chdir("/") after.

Returns
0, or -1 (errno set).

◆ getsid()

pid_t getsid ( pid_t pid)

◆ getuid()

uid_t getuid ( void )

user and group ids: real (who started the process) and effective (what it may do).

setuid/setgid as root set all ids; otherwise only to the real or saved id. set the group before giving up root.

◆ geteuid()

uid_t geteuid ( void )

◆ getgid()

gid_t getgid ( void )

◆ getegid()

gid_t getegid ( void )

◆ setuid()

int setuid ( uid_t uid)

◆ setgid()

int setgid ( gid_t gid)

◆ seteuid()

int seteuid ( uid_t uid)

◆ setegid()

int setegid ( gid_t gid)

◆ chown()

int chown ( const char * path,
uid_t uid,
gid_t gid )

change the owner of a file.

root may give a file to anyone; an owner may only change its group to its own. (uid_t)-1 or (gid_t)-1 keeps one.

◆ fchown()

int fchown ( int fd,
uid_t uid,
gid_t gid )

◆ lchown()

int lchown ( const char * path,
uid_t uid,
gid_t gid )

◆ fchownat()

int fchownat ( int dirfd,
const char * path,
uid_t uid,
gid_t gid,
int flags )

◆ getppid()

pid_t getppid ( void )

get the parent's process ID.

Returns
the parent's PID, or 0 if the parent has exited.

◆ sched_yield()

int sched_yield ( void )

let other ready processes run before this one continues.

Returns
0.

◆ getpid()

pid_t getpid ( void )

get the current process ID.

Returns
the current PID.

◆ sbrk()

void * sbrk ( int increment)

grow the program break (allocate heap memory).

Parameters
incrementnumber of bytes to grow by.
Returns
pointer to the previous break, or (void*)-1 on failure.

◆ getcwd()

char * getcwd ( char * buf,
size_t size )

get the current working directory.

Parameters
bufbuffer to write the path into; NULL: a new one from malloc (of size bytes, or as long as needed when size is 0).
sizesize of the buffer.
Returns
buf (or the new buffer), or NULL (errno: ERANGE, ENOMEM).

◆ chdir()

int chdir ( const char * path)

change the current working directory.

Parameters
pathpath to change to.
Returns
0 on success, -1 on failure.

◆ unlink()

int unlink ( const char * path)

remove (unlink) a file.

Parameters
pathpath to the file to remove.
Returns
0 on success, -1 on failure.

◆ symlink()

int symlink ( const char * target,
const char * path )

make a symbolic link at path that points at target

◆ symlinkat()

int symlinkat ( const char * target,
int dirfd,
const char * path )

◆ readlink()

ssize_t readlink ( const char *restrict path,
char *restrict buffer,
size_t size )

read a symbolic link's target (no NUL; a longer target is cut).

Returns
the bytes put in buffer, or -1 (EINVAL: path is not a link).

◆ readlinkat()

ssize_t readlinkat ( int dirfd,
const char *restrict path,
char *restrict buffer,
size_t size )

◆ link()

int link ( const char * old_path,
const char * new_path )

give a file one more name (a hard link)

◆ linkat()

int linkat ( int old_dirfd,
const char * old_path,
int new_dirfd,
const char * new_path,
int flags )

◆ unlinkat()

int unlinkat ( int dirfd,
const char * path,
int flags )

remove a file, or with AT_REMOVEDIR a directory, relative to dirfd

◆ rmdir()

int rmdir ( const char * path)

remove a directory.

Parameters
pathpath to the directory to remove.
Returns
0 on success, -1 on failure.

◆ create()

int create ( const char * path)

create a file, or truncate it if it exists (the file is not left open).

Parameters
pathpath to the file to create.
Returns
0 on success, -1 on failure.

◆ ttyctl()

int ttyctl ( int mode)

switch the terminal on fd 0 between two modes (a wrapper over termios): TTY_COOKED is line input with echo and signal keys; TTY_RAW gives one key_event_t per read (read_event), with no echo and Ctrl+C as a key.

the mode belongs to the terminal, so it stays after the program exits.

Parameters
modeTTY_COOKED or TTY_RAW.
Returns
the previous mode, or -1 on error.

◆ getpass()

char * getpass ( const char * prompt)

ask for a password on the terminal (standard input), without echo.

Returns
the line without its newline, in a static buffer (up to 127 bytes), or NULL at the end of input.

◆ isatty()

int isatty ( int fd)

true if fd refers to a terminal.

◆ ioctl()

int ioctl ( int fd,
unsigned int request,
void * arg )

issue a device-control request on an open file descriptor.

only device nodes under /dev service ioctls; other fds return -1/ENOTTY.

Parameters
fdopen file descriptor (e.g. an open "/dev/fb0").
requestdriver-defined request code.
argrequest-specific argument, usually a pointer to a struct.
Returns
0 (or a request-specific value) on success, -1 on error (errno set).

◆ read_event()

int read_event ( key_event_t * event)

read a single keyboard event from stdin (raw mode).

blocks until an event is available.

Parameters
eventpointer to event struct to fill.
Returns
0 on success, -1 on error.

◆ pipe()

int pipe ( int fds[2])

create a pipe (pair of connected file descriptors).

Parameters
fdsarray of two ints: fds[0] = read end, fds[1] = write end.
Returns
0 on success, -1 on failure.

◆ dup2()

int dup2 ( int old_fd,
int new_fd )

duplicate a file descriptor to a specific number.

if new_fd is already open, it is closed first.

Parameters
old_fdthe fd to duplicate.
new_fdthe target fd number.
Returns
new_fd on success, -1 on failure.

◆ ftruncate()

int ftruncate ( int fd,
off_t length )

cut or grow a file to length bytes (the new bytes read as zeros).

the file offset stays.

Returns
0, or -1 (errno set).

◆ truncate()

int truncate ( const char * path,
off_t length )

◆ lseek()

off_t lseek ( int fd,
off_t offset,
int whence )

set file cursor position.

Parameters
fdfile descriptor.
offsetbyte offset.
whenceSEEK_SET (from start), SEEK_CUR (from current), SEEK_END (from end).
Returns
new cursor position, or -1 on error (errno set).

◆ sysconf()

long sysconf ( int name)

a limit of the system (a SC name), or -1 with EINVAL

◆ pathconf()

long pathconf ( const char * path,
int name )

a limit of the files at path (a PC name).

ginnOS's limits are the same on every filesystem.

Returns
the limit, or -1 (errno: EINVAL for a name, or as stat sets it).

◆ fpathconf()

long fpathconf ( int fd,
int name )

◆ confstr()

size_t confstr ( int name,
char * buffer,
size_t size )

a string value of the system (a CS name) into buffer.

Returns
the size the whole value needs, NUL included; 0 with EINVAL for an unknown name.

◆ gethostname()

int gethostname ( char * name,
size_t length )

the name of this computer (uname's nodename) into name

◆ sethostname()

int sethostname ( const char * name,
size_t length )

set the host name (root only; at most 64 bytes)

◆ ttyname()

char * ttyname ( int fd)

the name of the terminal open as fd (as "/dev/pts/0").

Returns
the name in a static buffer, or NULL (errno: ENOTTY, EBADF).

◆ ttyname_r()

int ttyname_r ( int fd,
char * buffer,
size_t size )

◆ sync()

void sync ( void )

make every write reach the disk.

ginnOS writes through its cache at once, so there is nothing to wait for.

◆ daemon()

int daemon ( int keep_dir,
int keep_files )

go on in the background: a new process in a new session, with no terminal.

Parameters
keep_dir0: change to "/".
keep_files0: read and write /dev/null on 0, 1 and 2.
Returns
0 in the new process, or -1 (errno set).

◆ getopt()

int getopt ( int argc,
char *const argv[],
const char * options )

the next option of a command line (POSIX getopt).

Parameters
optionsthe option letters; a letter with ':' after it takes an argument. a ':' first: no messages, and ':' for a missing argument.
Returns
the option letter, '?' for an unknown one (in optopt), or -1 after the last option (optind is then the first operand).

◆ getentropy()

int getentropy ( void * buf,
size_t length )

fill buf with length random bytes (at most 256) from the kernel.

Returns
0, or -1 (errno EIO when length is more than 256).

◆ getlogin()

char * getlogin ( void )

the name of the user who runs the program (from the password file), or NULL

Variable Documentation

◆ optarg

char* optarg
extern

◆ optind

int optind
extern

◆ opterr

int opterr
extern

◆ optopt

int optopt
extern