Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1989-1996 Microsoft Corporation
  3. Module Name:
  4. fcntl.h
  5. Abstract:
  6. This module contains the required contents of fcntl
  7. --*/
  8. #ifndef _FCNTL_
  9. #define _FCNTL_
  10. #include <sys/types.h>
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define O_RDONLY 0x00000000
  15. #define O_WRONLY 0x00000001
  16. #define O_RDWR 0x00000002
  17. #define O_ACCMODE 0x00000007
  18. #define O_APPEND 0x00000008
  19. #define O_CREAT 0x00000100
  20. #define O_TRUNC 0x00000200
  21. #define O_EXCL 0x00000400
  22. #define O_NOCTTY 0x00000800
  23. #define O_NONBLOCK 0x00001000
  24. /*
  25. * Control operations on files, 1003.1-88 (6.5.2.2). Use as 'command'
  26. * argument to fcntl().
  27. */
  28. #define F_DUPFD 0
  29. #define F_GETFD 1
  30. #define F_GETLK 2
  31. #define F_SETFD 3
  32. #define F_GETFL 4
  33. #define F_SETFL 5
  34. #define F_SETLK 6
  35. #define F_SETLKW 7
  36. /*
  37. * File descriptor flags, 1003.1-90 (6-2). Used as argument to F_SETFD
  38. * command.
  39. */
  40. #define FD_CLOEXEC 0x1
  41. struct flock {
  42. short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
  43. short l_whence; /* flag for starting offset */
  44. off_t l_start; /* relative offset in bytes */
  45. off_t l_len; /* size; if 0 then until EOF */
  46. pid_t l_pid; /* pid of process holding the lock */
  47. };
  48. /*
  49. * Values for the l_type field.
  50. */
  51. #define F_RDLCK 1
  52. #define F_UNLCK 2
  53. #define F_WRLCK 3
  54. int __cdecl open(const char *, int,...);
  55. int __cdecl creat(const char *, mode_t);
  56. int __cdecl fcntl(int, int, ...);
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* _FCNTL_ */