1
0

unistd.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2006-2022, 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 <sys/types.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #define STDIN_FILENO 0 /* standard input file descriptor */
  19. #define STDOUT_FILENO 1 /* standard output file descriptor */
  20. #define STDERR_FILENO 2 /* standard error file descriptor */
  21. #define F_OK 0
  22. #define X_OK 1
  23. #define W_OK 2
  24. #define R_OK 4
  25. unsigned alarm(unsigned __secs);
  26. ssize_t read(int fd, void *buf, size_t len);
  27. ssize_t write(int fd, const void *buf, size_t len);
  28. off_t lseek(int fd, off_t offset, int whence);
  29. int pause(void);
  30. int fsync(int fildes);
  31. long sysconf(int __name);
  32. int unlink(const char *pathname);
  33. int close(int d);
  34. int ftruncate(int fd, off_t length);
  35. int rmdir(const char *path);
  36. int chdir(const char *path);
  37. char *getcwd(char *buf, size_t size);
  38. int access(const char *path, int amode);
  39. int pipe(int fildes[2]);
  40. int isatty(int fd);
  41. char *ttyname(int desc);
  42. unsigned int sleep(unsigned int seconds);
  43. int usleep(useconds_t usec);
  44. pid_t gettid(void);
  45. pid_t getpid(void);
  46. pid_t getppid(void);
  47. uid_t getuid(void);
  48. uid_t geteuid(void);
  49. gid_t getgid(void);
  50. gid_t getegid(void);
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif /* _SYS_UNISTD_H */