67int execve(
const char *path,
char *
const argv[],
char *
const envp[]);
73int execv(
const char *path,
char *
const argv[]);
87int execl(
const char *path,
const char *arg, ...);
89int execle(
const char *path,
const char *arg, ...);
104#define STDIN_FILENO 0
105#define STDOUT_FILENO 1
106#define STDERR_FILENO 2
141unsigned int alarm(
unsigned int seconds);
153unsigned int sleep(
unsigned int seconds);
254int symlink(
const char *target,
const char *path);
263int link(
const char *old_path,
const char *new_path);
264int linkat(
int old_dirfd,
const char *old_path,
int new_dirfd,
const char *new_path,
int flags);
317int ioctl(
int fd,
unsigned int request,
void *arg);
322#define CONSOLE_KEY_EVENT_CHAR 0
323#define CONSOLE_KEY_EVENT_SPECIAL 1
324#define CONSOLE_KEY_EVENT_RAW 2
327#define CONSOLE_KEY_UP 1
328#define CONSOLE_KEY_DOWN 2
329#define CONSOLE_KEY_LEFT 3
330#define CONSOLE_KEY_RIGHT 4
331#define CONSOLE_KEY_HOME 5
332#define CONSOLE_KEY_END 6
333#define CONSOLE_KEY_PAGE_UP 7
334#define CONSOLE_KEY_PAGE_DOWN 8
335#define CONSOLE_KEY_INSERT 9
336#define CONSOLE_KEY_DELETE 10
379int dup2(
int old_fd,
int new_fd);
405#define _SC_CHILD_MAX 1
407#define _SC_OPEN_MAX 4
408#define _SC_PAGESIZE 30
409#define _SC_PAGE_SIZE _SC_PAGESIZE
410#define _SC_NPROCESSORS_CONF 83
411#define _SC_NPROCESSORS_ONLN 84
412#define _SC_LINE_MAX 43
413#define _SC_HOST_NAME_MAX 180
414#define _SC_LOGIN_NAME_MAX 71
415#define _SC_PHYS_PAGES 85
421#define _PC_LINK_MAX 0
422#define _PC_MAX_CANON 1
423#define _PC_MAX_INPUT 2
424#define _PC_NAME_MAX 3
425#define _PC_PATH_MAX 4
426#define _PC_PIPE_BUF 5
427#define _PC_CHOWN_RESTRICTED 6
428#define _PC_NO_TRUNC 7
429#define _PC_VDISABLE 8
447size_t confstr(
int name,
char *buffer,
size_t size);
482int getopt(
int argc,
char *
const argv[],
const char *options);
file open flags and open().
uint8_t access
Definition gdt.c:3
uint8_t flags
Definition idt.c:3
int ioctl(int fd, unsigned int request, void *arg)
int dirfd(DIR *dir)
the file descriptor under a directory stream.
__INTPTR_TYPE__ intptr_t
Definition stdint.h:18
This file contains the declarations of system call numbers and the raw syscall interface.
int sched_yield(void)
give the CPU to another thread that is ready to run.
ELF32 file header.
Definition elf.h:51
an open-file description.
Definition file.h:64
keyboard event structure (matches kernel keyboard_event_t).
Definition unistd.h:343
int type
Definition unistd.h:344
__INT64_TYPE__ off_t
Definition types.h:20
__PTRDIFF_TYPE__ ssize_t
Definition types.h:15
int pid_t
Definition types.h:16
unsigned int uid_t
Definition types.h:17
unsigned int gid_t
Definition types.h:18
struct key_event_t::@170152312251240147374310354114104162231366201101::@001370202274002372066256151164273173007356006000 raw
int chdir(const char *path)
change the current working directory.
int ftruncate(int fd, off_t length)
cut or grow a file to length bytes (the new bytes read as zeros).
int symlink(const char *target, const char *path)
make a symbolic link at path that points at target
int execl(const char *path, const char *arg,...)
execv, execvp and execve with the arguments as a list that ends with NULL.
int fchownat(int dirfd, const char *path, uid_t uid, gid_t gid, int flags)
int nice(int increment)
add increment to the caller's nice value (see sys/resource.h).
int unlink(const char *path)
remove (unlink) a file.
int execle(const char *path, const char *arg,...)
uid_t getuid(void)
user and group ids: real (who started the process) and effective (what it may do).
int create(const char *path)
create a file, or truncate it if it exists (the file is not left open).
int faccessat(int dirfd, const char *path, int mode, int flags)
int linkat(int old_dirfd, const char *old_path, int new_dirfd, const char *new_path, int flags)
int symlinkat(const char *target, int dirfd, const char *path)
int pause(void)
sleep until a signal is caught.
int isatty(int fd)
true if fd refers to a terminal.
int fchown(int fd, uid_t uid, gid_t gid)
int dup(int fd)
duplicate a descriptor to the lowest free one; both share the open file.
int sethostname(const char *name, size_t length)
set the host name (root only; at most 64 bytes)
int getentropy(void *buf, size_t length)
fill buf with length random bytes (at most 256) from the kernel.
void * sbrk(int increment)
grow the program break (allocate heap memory).
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
int execlp(const char *file, const char *arg,...)
ssize_t pread(int fd, void *buf, size_t count, off_t offset)
read or write at an offset, without moving the file offset.
long sysconf(int name)
a limit of the system (a SC name), or -1 with EINVAL
unsigned int sleep(unsigned int seconds)
sleep for a number of seconds (or microseconds).
int lchown(const char *path, uid_t uid, gid_t gid)
int execve(const char *path, char *const argv[], char *const envp[])
replace the calling process's program.
long fpathconf(int fd, int name)
char * ttyname(int fd)
the name of the terminal open as fd (as "/dev/pts/0").
int truncate(const char *path, off_t length)
size_t confstr(int name, char *buffer, size_t size)
a string value of the system (a CS name) into buffer.
off_t lseek(int fd, off_t offset, int whence)
set file cursor position.
unsigned int alarm(unsigned int seconds)
send SIGALRM to the calling process after a number of seconds.
ssize_t readlinkat(int dirfd, const char *restrict path, char *restrict buffer, size_t size)
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 se...
int fsync(int fd)
write an open file's data to disk.
int read_event(key_event_t *event)
read a single keyboard event from stdin (raw mode).
void _exit(int status) __attribute__((noreturn))
terminate the current process.
pid_t fork(void)
create a child process that is a copy of the caller.
long pathconf(const char *path, int name)
a limit of the files at path (a PC name).
char * getpass(const char *prompt)
ask for a password on the terminal (standard input), without echo.
int pipe(int fds[2])
create a pipe (pair of connected file descriptors).
int getopt(int argc, char *const argv[], const char *options)
the next option of a command line (POSIX getopt).
int close(int fd)
close a file descriptor.
int rmdir(const char *path)
remove a directory.
int ttyname_r(int fd, char *buffer, size_t size)
ssize_t write(int fd, const void *buf, size_t count)
write bytes to a file descriptor.
void sync(void)
make every write reach the disk.
pid_t getpid(void)
get the current process ID.
pid_t getppid(void)
get the parent's process ID.
char * getcwd(char *buf, size_t size)
get the current working directory.
int usleep(unsigned int microseconds)
int unlinkat(int dirfd, const char *path, int flags)
remove a file, or with AT_REMOVEDIR a directory, relative to dirfd
int daemon(int keep_dir, int keep_files)
go on in the background: a new process in a new session, with no terminal.
int link(const char *old_path, const char *new_path)
give a file one more name (a hard link)
int execv(const char *path, char *const argv[])
execve with the environment of the calling process.
int setpgid(pid_t pid, pid_t pgid)
process groups and sessions (job control).
int gethostname(char *name, size_t length)
the name of this computer (uname's nodename) into name
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).
int dup2(int old_fd, int new_fd)
duplicate a file descriptor to a specific number.
ssize_t read(int fd, void *buf, size_t count)
read bytes from a file descriptor.
int ttyctl(int mode)
switch the terminal on fd 0 between two modes (a wrapper over termios): TTY_COOKED is line input with...
pid_t exec(const char *path, const char **argv)
execute a program, spawning a child process.
char * getlogin(void)
the name of the user who runs the program (from the password file), or NULL
int chroot(const char *path)
make a directory the root of the caller's paths ("/" is then that directory; root only).
int chown(const char *path, uid_t uid, gid_t gid)
change the owner of a file.
waiting for child processes.