unistd.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-12-16 Meco Man add usleep
  9. * 2021-09-11 Meco Man move functions from dfs_posix.h to unistd.h
  10. */
  11. #ifndef __SYS_UNISTD_H__
  12. #define __SYS_UNISTD_H__
  13. #include <stddef.h>
  14. #include "types.h" /* <sys/types.h> */
  15. #define STDIN_FILENO 0 /* standard input file descriptor */
  16. #define STDOUT_FILENO 1 /* standard output file descriptor */
  17. #define STDERR_FILENO 2 /* standard error file descriptor */
  18. ssize_t read(int fd, void *buf, size_t len);
  19. ssize_t write(int fd, const void *buf, size_t len);
  20. off_t lseek(int fd, off_t offset, int whence);
  21. int fsync(int fildes);
  22. int unlink(const char *pathname);
  23. int close(int d);
  24. int ftruncate(int fd, off_t length);
  25. int rmdir(const char *path);
  26. int chdir(const char *path);
  27. char *getcwd(char *buf, size_t size);
  28. int access(const char *path, int amode);
  29. int pipe(int fildes[2]);
  30. int isatty(int fd);
  31. char *ttyname(int desc);
  32. unsigned int sleep(unsigned int seconds);
  33. int usleep(useconds_t usec);
  34. pid_t gettid(void);
  35. pid_t getpid(void);
  36. pid_t getppid(void);
  37. uid_t getuid(void);
  38. uid_t geteuid(void);
  39. gid_t getgid(void);
  40. gid_t getegid(void);
  41. #endif /* _SYS_UNISTD_H */