unistd.h 718 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __GBLIBC_UNISTD_H_
  2. #define __GBLIBC_UNISTD_H_
  3. #include <sys/types.h>
  4. #undef STDOUT_FILENO
  5. #undef STDIN_FILENO
  6. #undef STDERR_FILENO
  7. #define STDIN_FILENO (0)
  8. #define STDOUT_FILENO (1)
  9. #define STDERR_FILENO (2)
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. ssize_t read(int fd, void* buf, size_t count);
  14. ssize_t write(int fd, const void* buf, size_t count);
  15. int close(int fd);
  16. void __attribute__((noreturn)) _exit(int code);
  17. pid_t fork(void);
  18. int execve(const char* pathname, char* const argv[], char* const envp[]);
  19. unsigned int sleep(unsigned int seconds);
  20. int chdir(const char* path);
  21. char* getcwd(char* buf, size_t bufsize);
  22. pid_t setsid(void);
  23. pid_t getsid(pid_t pid);
  24. #ifdef __cplusplus
  25. }
  26. #endif
  27. #endif