sysconst.inc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Michael Van Canneyt,
  5. member of the Free Pascal development team.
  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. {BSD version, only the blocks with BSD in the comment are updated}
  13. Const
  14. { Things for LSEEK call, same in linux and BSD }
  15. Seek_set = 0;
  16. Seek_Cur = 1;
  17. Seek_End = 2;
  18. { Things for OPEN call - after include/sys/fcntl.h, BSD updated.
  19. BSD specifies these constants in hex }
  20. Open_Accmode = 3;
  21. Open_RdOnly = 0;
  22. Open_WrOnly = 1;
  23. Open_RdWr = 2;
  24. Open_NonBlock = 4;
  25. Open_Append = 8;
  26. Open_ShLock = $10;
  27. Open_ExLock = $20;
  28. Open_ASync = $40;
  29. Open_FSync = $80;
  30. Open_NoFollow = $100;
  31. Open_Create = $200; {BSD convention}
  32. Open_Creat = $200; {Linux convention}
  33. Open_Trunc = $400;
  34. Open_Excl = $800;
  35. Open_NoCTTY = $8000;
  36. { The waitpid uses the following options:}
  37. Wait_NoHang = 1;
  38. Wait_UnTraced = 2;
  39. Wait_Any = -1;
  40. Wait_MyPGRP = 0;
  41. { Constants to check stat.mode - checked all STAT constants with BSD}
  42. STAT_IFMT = $f000; {00170000 }
  43. STAT_IFSOCK = $c000; {0140000 }
  44. STAT_IFLNK = $a000; {0120000 }
  45. STAT_IFREG = $8000; {0100000 }
  46. STAT_IFBLK = $6000; {0060000 }
  47. STAT_IFDIR = $4000; {0040000 }
  48. STAT_IFCHR = $2000; {0020000 }
  49. STAT_IFIFO = $1000; {0010000 }
  50. STAT_ISUID = $0800; {0004000 }
  51. STAT_ISGID = $0400; {0002000 }
  52. STAT_ISVTX = $0200; {0001000}
  53. { Constants to check permissions all }
  54. STAT_IRWXO = $7;
  55. STAT_IROTH = $4;
  56. STAT_IWOTH = $2;
  57. STAT_IXOTH = $1;
  58. STAT_IRWXG = STAT_IRWXO shl 3;
  59. STAT_IRGRP = STAT_IROTH shl 3;
  60. STAT_IWGRP = STAT_IWOTH shl 3;
  61. STAT_IXGRP = STAT_IXOTH shl 3;
  62. STAT_IRWXU = STAT_IRWXO shl 6;
  63. STAT_IRUSR = STAT_IROTH shl 6;
  64. STAT_IWUSR = STAT_IWOTH shl 6;
  65. STAT_IXUSR = STAT_IXOTH shl 6;
  66. { Constants to test the type of filesystem }
  67. fs_old_ext2 = $ef51;
  68. fs_ext2 = $ef53;
  69. fs_ext = $137d;
  70. fs_iso = $9660;
  71. fs_minix = $137f;
  72. fs_minix_30 = $138f;
  73. fs_minux_V2 = $2468;
  74. fs_msdos = $4d44;
  75. fs_nfs = $6969;
  76. fs_proc = $9fa0;
  77. fs_xia = $012FD16D;
  78. { Constansts for MMAP }
  79. MAP_PRIVATE =2;
  80. MAP_ANONYMOUS =$1000;
  81. {Constansts Termios/Ioctl (used in Do_IsDevice) }
  82. IOCtl_TCGETS=$5401; // TCGETS is also in termios.inc, but the sysunix needs only this
  83. {Checked for BSD using Linuxthreads port}
  84. { cloning flags }
  85. CSIGNAL = $000000ff; // signal mask to be sent at exit
  86. CLONE_VM = $00000100; // set if VM shared between processes
  87. CLONE_FS = $00000200; // set if fs info shared between processes
  88. CLONE_FILES = $00000400; // set if open files shared between processes
  89. CLONE_SIGHAND = $00000800; // set if signal handlers shared
  90. CLONE_PID = $00001000; // set if pid shared
  91. type
  92. TCloneFunc=function(args:pointer):longint;cdecl;
  93. {
  94. $Log$
  95. Revision 1.5 2001-10-14 13:33:20 peter
  96. * start of thread support for linux
  97. Revision 1.4 2001/06/19 08:34:16 marco
  98. * Peter didn't merge the FreeBSD directory when he merged the Unix one. Fixed
  99. Revision 1.3 2001/01/23 20:37:14 marco
  100. * Serial.pp in makefile, Open_Noccty added to sysconst.inc
  101. Revision 1.2 2000/09/18 13:42:35 marco
  102. * FreeBSD support into 1.1
  103. Revision 1.4 2000/09/11 14:38:10 marco
  104. * 14 april version killed, and replaced by newer fixes branch version
  105. Revision 1.1 2000/07/13 06:30:33 michael
  106. + Initial import
  107. Revision 1.5 2000/04/10 15:46:52 marco
  108. * worked all day. probably a lot changed
  109. Revision 1.3 2000/02/03 17:05:13 marco
  110. * fixes and updates due to linux unit porting
  111. Revision 1.2 2000/02/02 16:35:29 marco
  112. * Checked stat constants
  113. Revision 1.1 2000/02/02 15:41:28 marco
  114. * initial BSD version.
  115. Revision 1.4 2000/01/07 16:41:41 daniel
  116. * copyright 2000
  117. Revision 1.3 2000/01/07 16:32:28 daniel
  118. * copyright 2000 added
  119. Revision 1.2 1998/05/06 12:38:22 michael
  120. + Removed log from before restored version.
  121. Revision 1.1.1.1 1998/03/25 11:18:43 root
  122. * Restored version
  123. }