unistd.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. unsigned alarm(unsigned __secs);
  19. ssize_t read(int fd, void *buf, size_t len);
  20. ssize_t write(int fd, const void *buf, size_t len);
  21. off_t lseek(int fd, off_t offset, int whence);
  22. int pause(void);
  23. int fsync(int fildes);
  24. long sysconf(int __name);
  25. int unlink(const char *pathname);
  26. int close(int d);
  27. int ftruncate(int fd, off_t length);
  28. int rmdir(const char *path);
  29. int chdir(const char *path);
  30. char *getcwd(char *buf, size_t size);
  31. int access(const char *path, int amode);
  32. int pipe(int fildes[2]);
  33. int isatty(int fd);
  34. char *ttyname(int desc);
  35. unsigned int sleep(unsigned int seconds);
  36. int usleep(useconds_t usec);
  37. pid_t gettid(void);
  38. pid_t getpid(void);
  39. pid_t getppid(void);
  40. uid_t getuid(void);
  41. uid_t geteuid(void);
  42. gid_t getgid(void);
  43. gid_t getegid(void);
  44. #endif /* _SYS_UNISTD_H */