unxconst.inc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by Michael Van Canneyt,
  4. member of the Free Pascal development team.
  5. Constants for Unix unit.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {
  13. Copied from freebsd directory 2011-09-09
  14. }
  15. const
  16. { Things for LSEEK call, OK:OpenBSD sys/unistd.h 4.9 }
  17. Seek_set = 0;
  18. Seek_Cur = 1;
  19. Seek_End = 2;
  20. { Things for OPEN call - after include/sys/fcntl.h,
  21. OK:OpenBSD sys/fcntl.h 4.9
  22. BSD specifies these constants in hex }
  23. Open_Accmode = 3;
  24. Open_RdOnly = 0;
  25. Open_WrOnly = 1;
  26. Open_RdWr = 2;
  27. Open_NonBlock = 4;
  28. Open_Append = 8;
  29. Open_ShLock = $10;
  30. Open_ExLock = $20;
  31. Open_ASync = $40;
  32. Open_FSync = $80;
  33. Open_NoFollow = $100;
  34. Open_Create = $200; {BSD convention}
  35. Open_Creat = $200; {Linux convention}
  36. Open_Trunc = $400;
  37. Open_Excl = $800;
  38. Open_NoCTTY = $8000;
  39. { The waitpid uses the following options:
  40. OK:OpenBSD sys/wait.h 4.9 }
  41. Wait_NoHang = 1;
  42. Wait_UnTraced = 2;
  43. Wait_Any = -1;
  44. Wait_MyPGRP = 0;
  45. { Constants to check stat.mode - checked all STAT constants with BSD
  46. OK:OpenBSD sys/stat.h 4.9 }
  47. STAT_IFMT = $f000; {00170000 }
  48. STAT_IFSOCK = $c000; {0140000 }
  49. STAT_IFLNK = $a000; {0120000 }
  50. STAT_IFREG = $8000; {0100000 }
  51. STAT_IFBLK = $6000; {0060000 }
  52. STAT_IFDIR = $4000; {0040000 }
  53. STAT_IFCHR = $2000; {0020000 }
  54. STAT_IFIFO = $1000; {0010000 }
  55. STAT_ISUID = $0800; {0004000 }
  56. STAT_ISGID = $0400; {0002000 }
  57. STAT_ISVTX = $0200; {0001000}
  58. { Constants to check permissions all }
  59. STAT_IRWXO = $7;
  60. STAT_IROTH = $4;
  61. STAT_IWOTH = $2;
  62. STAT_IXOTH = $1;
  63. STAT_IRWXG = STAT_IRWXO shl 3;
  64. STAT_IRGRP = STAT_IROTH shl 3;
  65. STAT_IWGRP = STAT_IWOTH shl 3;
  66. STAT_IXGRP = STAT_IXOTH shl 3;
  67. STAT_IRWXU = STAT_IRWXO shl 6;
  68. STAT_IRUSR = STAT_IROTH shl 6;
  69. STAT_IWUSR = STAT_IWOTH shl 6;
  70. STAT_IXUSR = STAT_IXOTH shl 6;
  71. { Not checked below for OpenBSD 4.9 }
  72. { Constants to test the type of filesystem }
  73. fs_old_ext2 = $ef51;
  74. fs_ext2 = $ef53;
  75. fs_ext = $137d;
  76. fs_iso = $9660;
  77. fs_minix = $137f;
  78. fs_minix_30 = $138f;
  79. fs_minux_V2 = $2468;
  80. fs_msdos = $4d44;
  81. fs_nfs = $6969;
  82. fs_proc = $9fa0;
  83. fs_xia = $012FD16D;
  84. {Constansts Termios/Ioctl (used in Do_IsDevice) }
  85. IOCtl_TCGETS= $40000000+$2C7400+ 19; // TCGETS is also in termios.inc, but the sysunix needs only this
  86. ITimer_Real =0;
  87. ITimer_Virtual =1;
  88. ITimer_Prof =2;
  89. {
  90. {Checked for BSD using Linuxthreads port}
  91. { cloning flags }
  92. CSIGNAL = $000000ff; // signal mask to be sent at exit
  93. CLONE_VM = $00000100; // set if VM shared between processes
  94. CLONE_FS = $00000200; // set if fs info shared between processes
  95. CLONE_FILES = $00000400; // set if open files shared between processes
  96. CLONE_SIGHAND = $00000800; // set if signal handlers shared
  97. CLONE_PID = $00001000; // set if pid shared
  98. type
  99. TCloneFunc=function(args:pointer):longint;cdecl;
  100. }