unxconst.inc 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. const
  2. { Things for OPEN call - after include/sys/fcntl.h,
  3. BSD specifies these constants in hex }
  4. Open_Accmode = 3;
  5. // Open_RdOnly = 0;
  6. // Open_WrOnly = 1;
  7. // Open_RdWr = 2;
  8. // Open_NonBlock = 4;
  9. // Open_Append = 8;
  10. Open_ShLock = $10;
  11. Open_ExLock = $20;
  12. Open_ASync = $40;
  13. Open_FSync = $80;
  14. Open_NoFollow = $100;
  15. Open_Create = $200; {BSD convention}
  16. // Open_Creat = $200; {Linux convention}
  17. // Open_Trunc = $400;
  18. // Open_Excl = $800;
  19. // Open_NoCTTY = $8000;
  20. {***********************************************************************}
  21. { POSIX CONSTANT ROUTINE DEFINITIONS }
  22. {***********************************************************************}
  23. CONST
  24. { access routine - these maybe OR'ed together }
  25. F_OK = 0; { test for existence of file }
  26. R_OK = 4; { test for read permission on file }
  27. W_OK = 2; { test for write permission on file }
  28. X_OK = 1; { test for execute or search permission }
  29. { seek routine }
  30. SEEK_SET = 0; { seek from beginning of file }
  31. SEEK_CUR = 1; { seek from current position }
  32. SEEK_END = 2; { seek from end of file }
  33. { open routine }
  34. { File access modes for `open' and `fcntl'. }
  35. OPEN_RDONLY = 0; { Open read-only. }
  36. OPEN_WRONLY = 1; { Open write-only. }
  37. OPEN_RDWR = 2; { Open read/write. }
  38. { Bits OR'd into the second argument to open. }
  39. OPEN_CREAT = $200; { Create file if it doesn't exist. }
  40. OPEN_EXCL = $800; { Fail if file already exists. }
  41. OPEN_TRUNC = $400; { Truncate file to zero length. }
  42. OPEN_NOCTTY = $8000; { Don't assign a controlling terminal. }
  43. { File status flags for `open' and `fcntl'. }
  44. OPEN_APPEND = 8; { Writes append to the file. }
  45. OPEN_NONBLOCK = 4; { Non-blocking I/O. }
  46. { mode_t possible values }
  47. { Constants to check stat.mode - checked all STAT constants with Haiku}
  48. STAT_IFMT = $f000; {0170000 }
  49. STAT_IFSOCK = $c000; {0140000 }
  50. STAT_IFLNK = $a000; {0120000 }
  51. STAT_IFREG = $8000; {0100000 }
  52. STAT_IFBLK = $6000; {0060000 }
  53. STAT_IFDIR = $4000; {0040000 }
  54. STAT_IFCHR = $2000; {0020000 }
  55. STAT_IFIFO = $1000; {0010000 }
  56. STAT_ISUID = $0800; {0004000 }
  57. STAT_ISGID = $0400; {0002000 }
  58. STAT_ISVTX = $0200; {0001000}
  59. STAT_IRWXU = %0111000000; { Read, Write, Exec permission for owner }
  60. STAT_IRUSR = %0100000000; { Read permission for owner }
  61. STAT_IWUSR = %0010000000; { Write permission for owner }
  62. STAT_IXUSR = %0001000000; { Exec permission for owner }
  63. STAT_IRWXG = %0000111000; { Read, Write, Exec permission for group }
  64. STAT_IRGRP = %0000100000; { Read permission for group }
  65. STAT_IWGRP = %0000010000; { Write permission for group }
  66. STAT_IXGRP = %0000001000; { Exec permission for group }
  67. STAT_IRWXO = %0000000111; { Read, Write, Exec permission for world }
  68. STAT_IROTH = %0000000100; { Read permission for world }
  69. STAT_IWOTH = %0000000010; { Write permission for world }
  70. STAT_IXOTH = %0000000001; { Exec permission for world }
  71. { Used for waitpid }
  72. WAIT_NOHANG = 1; { don't block waiting }
  73. WAIT_UNTRACED = 2; { report status of stopped children }