49 lines
989 B
C
49 lines
989 B
C
/* unistd.h: POSIX constants and functions. */
|
|
|
|
#ifndef _UNISTD_H
|
|
#define _UNISTD_H
|
|
|
|
#define __need_NULL
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
#include <sys/types.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
pid_t fork();
|
|
|
|
/* Return the current process' process ID. */
|
|
pid_t getpid(void);
|
|
|
|
int execv(const char*, char* const*);
|
|
int execve(const char*, char* const*, char* const*);
|
|
int execvp(const char*, char* const*);
|
|
|
|
/* Call the operating system kernel for a specific service. */
|
|
long syscall(long num, ...);
|
|
|
|
/* Sleep for X microseconds. */
|
|
int usleep(useconds_t us);
|
|
|
|
/* Sleep for X seconds. */
|
|
unsigned long sleep(unsigned long seconds);
|
|
|
|
/* Close a file descriptor. */
|
|
int close(int fd);
|
|
|
|
/* Read bytes from a file descriptor. */
|
|
ssize_t read(int fd, void* buf, size_t size);
|
|
|
|
/* Write bytes to a file descriptor. */
|
|
ssize_t write(int fd, const void* buf, size_t size);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|