Luna/libc/include/unistd.h

56 lines
1.1 KiB
C
Raw Normal View History

/* unistd.h: POSIX constants and functions. */
#ifndef _UNISTD_H
#define _UNISTD_H
#define __need_NULL
#include <stddef.h>
#include <bits/seek.h>
#include <stdint.h>
#include <sys/types.h>
#define STDOUT_FILENO 0
#define STDERR_FILENO 1
#ifdef __cplusplus
extern "C"
{
#endif
pid_t fork();
2023-03-11 21:19:58 +00:00
2023-03-12 10:15:45 +00:00
/* Return the current process' process ID. */
2023-03-11 21:19:58 +00:00
pid_t getpid(void);
int execv(const char*, char* const*);
int execve(const char*, char* const*, char* const*);
int execvp(const char*, char* const*);
2023-03-12 10:15:45 +00:00
/* Call the operating system kernel for a specific service. */
long syscall(long num, ...);
2023-03-12 10:15:45 +00:00
/* Sleep for X microseconds. */
int usleep(useconds_t us);
2023-03-12 10:15:45 +00:00
/* Sleep for X seconds. */
unsigned long sleep(unsigned long seconds);
2023-03-12 10:15:45 +00:00
/* Close a file descriptor. */
int close(int fd);
2023-03-12 10:15:45 +00:00
/* Read bytes from a file descriptor. */
2023-03-11 17:02:50 +00:00
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);
/* Modify a file descriptor's offset. */
off_t lseek(int fd, off_t offset, int whence);
#ifdef __cplusplus
}
#endif
#endif