2023-01-06 20:02:07 +01:00
|
|
|
/* unistd.h: POSIX constants and functions. */
|
|
|
|
|
2023-01-06 13:31:14 +01:00
|
|
|
#ifndef _UNISTD_H
|
|
|
|
#define _UNISTD_H
|
|
|
|
|
2023-01-06 20:02:07 +01:00
|
|
|
#define __need_NULL
|
|
|
|
#include <stddef.h>
|
|
|
|
|
2023-01-06 17:35:07 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2023-01-06 13:31:14 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2023-01-06 17:35:07 +01:00
|
|
|
pid_t fork();
|
2023-03-11 22:19:58 +01:00
|
|
|
|
|
|
|
/* Returns the current process' process ID. */
|
|
|
|
pid_t getpid(void);
|
2023-01-06 17:35:07 +01:00
|
|
|
|
|
|
|
int execv(const char*, char* const*);
|
|
|
|
int execve(const char*, char* const*, char* const*);
|
|
|
|
int execvp(const char*, char* const*);
|
|
|
|
|
2023-01-06 20:02:07 +01:00
|
|
|
/* Calls the operating system kernel for a specific service. */
|
|
|
|
long syscall(long num, ...);
|
2023-01-06 13:31:14 +01:00
|
|
|
|
2023-01-22 15:00:20 +01:00
|
|
|
/* Sleeps for X microseconds. */
|
|
|
|
int usleep(useconds_t us);
|
|
|
|
|
|
|
|
/* Sleeps for X seconds. */
|
|
|
|
unsigned long sleep(unsigned long seconds);
|
|
|
|
|
2023-03-11 17:45:20 +01:00
|
|
|
/* Closes a file descriptor. */
|
|
|
|
int close(int fd);
|
|
|
|
|
2023-03-11 18:02:50 +01:00
|
|
|
/* Reads bytes from a file descriptor. */
|
|
|
|
ssize_t read(int fd, void* buf, size_t size);
|
|
|
|
|
2023-01-06 13:31:14 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|