unistd.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) mlibc & plct lab
  3. *
  4. * SPDX-License-Identifier: MIT
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023/06/16 bernard the first verison
  9. */
  10. #ifndef MLIBC_UNISTD_H__
  11. #define MLIBC_UNISTD_H__
  12. #include <sys/types.h>
  13. #define _POSIX_VDISABLE 0
  14. #define STDIN_FILENO 0
  15. #define STDOUT_FILENO 1
  16. #define STDERR_FILENO 2
  17. #define F_OK 0
  18. #define R_OK 4
  19. #define W_OK 2
  20. #define X_OK 1
  21. int pipe(int [2]);
  22. int pipe2(int [2], int);
  23. int creat(const char *path, mode_t mode);
  24. int close(int d);
  25. int fsync(int fildes);
  26. ssize_t read(int fd, void *buf, size_t len);
  27. ssize_t write(int fd, const void *buf, size_t count);
  28. /*
  29. * long sysconf(int name);
  30. * Gets the configuration information executed by the system
  31. *
  32. * size_t confstr(int name, char *buf, size_t len);
  33. * Gets the value of a string variable that depends on configuration
  34. */
  35. off_t lseek(int fd, off_t offset, int whence);
  36. int unlink(const char *pathname);
  37. char *getcwd(char *buf, size_t size);
  38. int fcntl(int fd, int cmd, ... /* arg */ );
  39. int ioctl(int fildes, int cmd, ...);
  40. int chdir(const char *path);
  41. int mkdir(const char *pathname, mode_t mode);
  42. int rmdir(const char *pathname);
  43. int truncate(const char *, off_t);
  44. int ftruncate(int, off_t);
  45. int access(const char *, int);
  46. int faccessat(int, const char *, int, int);
  47. #include <sys/stat.h>
  48. #endif /*MLIBC_UNISTD_H__*/