12 #define STDIN_FILENO 0
13 #define STDOUT_FILENO 1
14 #define STDERR_FILENO 2
16 #define stdin STDIN_FILENO
17 #define stdout STDOUT_FILENO
18 #define stderr STDERR_FILENO
65 int symlink(
const char *linkname,
const char *path);
72 int readlink(
const char *path,
char *buffer,
size_t bufsize);
76 extern void exit(
int status);
172 int execl(
const char *path,
const char *arg, ...);
181 int execlp(
const char *file,
const char *arg, ...);
189 int execle(
const char *path,
const char *arg, ...);
198 int execlpe(
const char *file,
const char *arg, ...);
205 int execv(
const char *path,
char *
const argv[]);
213 int execvp(
const char *file,
char *
const argv[]);
224 int execve(
const char *path,
char *
const argv[],
char *
const envp[]);
236 int execvpe(
const char *file,
char *
const argv[],
char *
const envp[]);
253 int reboot(
int magic1,
int magic2,
unsigned int cmd,
void *arg);
Functions used to manage directories.
signed int pid_t
The type of process id.
Definition: types.h:9
int gid_t
The type of group-id.
Definition: stddef.h:43
long ssize_t
Define the generic signed size type.
Definition: stddef.h:31
long int off_t
The type of offset.
Definition: stddef.h:46
unsigned int mode_t
The type of mode.
Definition: stddef.h:49
int uid_t
The type of user-id.
Definition: stddef.h:40
Directory entry.
Definition: dirent.h:44
Contains user group informations.
Definition: grp.h:14
int readlink(const char *path, char *buffer, size_t bufsize)
Read the symbolic link, if present.
int setreuid(uid_t ruid, uid_t euid)
Sets the effective and real User IDs of the calling process.
int lchown(const char *pathname, uid_t owner, gid_t group)
Change the owner and group of a file.
int fchdir(int fd)
Is identical to chdir(), the only difference is that the directory is given as an open file descripto...
int execl(const char *path, const char *arg,...)
Replaces the current process image with a new process image (argument list).
Definition: exec.c:97
int chmod(const char *pathname, mode_t mode)
Change the file's mode bits.
int fchown(int fd, uid_t owner, gid_t group)
Change the owner and group of a file.
int unlink(const char *path)
Delete a name and possibly the file it refers to.
int execle(const char *path, const char *arg,...)
Replaces the current process image with a new process image (argument list).
Definition: exec.c:158
uid_t getuid(void)
Returns the real User ID of the calling process.
int setgid(gid_t gid)
sets the group IDs of the calling process.
char * getcwd(char *buf, size_t size)
Get current working directory.
pid_t getsid(pid_t pid)
Return session id of the given process. If pid == 0 return the SID of the calling process If pid !...
ssize_t write(int fd, const void *buf, size_t nbytes)
Write data into a file descriptor.
pid_t setsid(void)
creates a new session if the calling process is not a process group leader. The calling process is th...
gid_t getegid(void)
returns the effective group ID of the calling process.
int fchmod(int fd, mode_t mode)
Change the file's mode bits.
pid_t getpgid(pid_t pid)
returns the Process Group ID (PGID) of the process specified by pid. If pid is zero,...
int dup(int fd)
Return a new file descriptor.
int open(const char *pathname, int flags, mode_t mode)
Opens the file specified by pathname.
void exit(int status)
Wrapper for exit system call.
Definition: exit.c:9
gid_t getgid(void)
returns the real group ID of the calling process.
int execlp(const char *file, const char *arg,...)
Replaces the current process image with a new process image (argument list).
Definition: exec.c:126
int execlpe(const char *file, const char *arg,...)
Replaces the current process image with a new process image (argument list).
Definition: exec.c:198
int execve(const char *path, char *const argv[], char *const envp[])
Replaces the current process image with a new process image (argument vector), allows the caller to s...
Definition: exec.c:61
int chown(const char *pathname, uid_t owner, gid_t group)
Change the owner and group of a file.
int reboot(int magic1, int magic2, unsigned int cmd, void *arg)
Reboots the system, or enables/disables the reboot keystroke.
int setregid(gid_t rgid, gid_t egid)
sets the real and effective group IDs of the calling process.
uid_t geteuid(void)
Returns the effective User ID of the calling process.
off_t lseek(int fd, off_t offset, int whence)
Repositions the file offset inside a file.
ssize_t read(int fd, void *buf, size_t nbytes)
Read data from a file descriptor.
int execvp(const char *file, char *const argv[])
Replaces the current process image with a new process image (argument vector).
Definition: exec.c:73
int setuid(uid_t uid)
Sets the User IDs of the calling process.
pid_t fork(void)
Clone the calling process, but without copying the whole address space. The calling process is suspen...
int symlink(const char *linkname, const char *path)
Creates a symbolic link.
int nice(int inc)
Adds inc to the nice value for the calling thread.
int close(int fd)
Close a file descriptor.
int chdir(char const *path)
Changes the current working directory to the given path.
pid_t getpid(void)
Returns the process ID (PID) of the calling process.
pid_t getppid(void)
Returns the parent process ID (PPID) of the calling process.
int execvpe(const char *file, char *const argv[], char *const envp[])
Replaces the current process image with a new process image (argument vector), allows the caller to s...
Definition: exec.c:78
int execv(const char *path, char *const argv[])
Replaces the current process image with a new process image (argument vector).
Definition: exec.c:68
int setpgid(pid_t pid, pid_t pgid)
Sets the Process Group ID (PGID) of the process specified by pid. If pid is zero, the process ID of t...
ssize_t getdents(int fd, dirent_t *dirp, unsigned int count)
unsigned alarm(int seconds)
Send signal to calling thread after desired seconds.