sysconst.inc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. { For getting/setting priority }
  15. Prio_Process = 0;
  16. Prio_PGrp = 1;
  17. Prio_User = 2;
  18. { Things for LSEEK call, same in linux and BSD }
  19. Seek_set = 0;
  20. Seek_Cur = 1;
  21. Seek_End = 2;
  22. { Things for OPEN call - after include/sys/fcntl.h, BSD updated.
  23. BSD specifies these constants in hex }
  24. Open_Accmode = 3;
  25. Open_RdOnly = 0;
  26. Open_WrOnly = 1;
  27. Open_RdWr = 2;
  28. Open_NonBlock = 4;
  29. Open_Append = 8;
  30. Open_ShLock = $10;
  31. Open_ExLock = $20;
  32. Open_ASync = $40;
  33. Open_FSync = $80;
  34. Open_NoFollow = $100;
  35. Open_Create = $200; {BSD convention}
  36. Open_Creat = $200; {Linux convention}
  37. Open_Trunc = $400;
  38. Open_Excl = $800;
  39. Open_NOCTTY = $8000;
  40. { The waitpid uses the following options:}
  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. STAT_IFMT = $f000; {00170000 }
  47. STAT_IFSOCK = $c000; {0140000 }
  48. STAT_IFLNK = $a000; {0120000 }
  49. STAT_IFREG = $8000; {0100000 }
  50. STAT_IFBLK = $6000; {0060000 }
  51. STAT_IFDIR = $4000; {0040000 }
  52. STAT_IFCHR = $2000; {0020000 }
  53. STAT_IFIFO = $1000; {0010000 }
  54. STAT_ISUID = $0800; {0004000 }
  55. STAT_ISGID = $0400; {0002000 }
  56. STAT_ISVTX = $0200; {0001000}
  57. { Constants to check permissions all }
  58. STAT_IRWXO = $7;
  59. STAT_IROTH = $4;
  60. STAT_IWOTH = $2;
  61. STAT_IXOTH = $1;
  62. STAT_IRWXG = STAT_IRWXO shl 3;
  63. STAT_IRGRP = STAT_IROTH shl 3;
  64. STAT_IWGRP = STAT_IWOTH shl 3;
  65. STAT_IXGRP = STAT_IXOTH shl 3;
  66. STAT_IRWXU = STAT_IRWXO shl 6;
  67. STAT_IRUSR = STAT_IROTH shl 6;
  68. STAT_IWUSR = STAT_IWOTH shl 6;
  69. STAT_IXUSR = STAT_IXOTH shl 6;
  70. { Constants to test the type of filesystem }
  71. fs_old_ext2 = $ef51;
  72. fs_ext2 = $ef53;
  73. fs_ext = $137d;
  74. fs_iso = $9660;
  75. fs_minix = $137f;
  76. fs_minix_30 = $138f;
  77. fs_minux_V2 = $2468;
  78. fs_msdos = $4d44;
  79. fs_nfs = $6969;
  80. fs_proc = $9fa0;
  81. fs_xia = $012FD16D;
  82. { Constansts for MMAP }
  83. MAP_PRIVATE =2;
  84. MAP_ANONYMOUS =$1000;
  85. {Constansts Termios/Ioctl (used in Do_IsDevice) }
  86. IOCtl_TCGETS=$5401; // TCGETS is also in termios.inc, but the sysunix needs only this
  87. // a type, and a wrong one. only for quick port atm.
  88. type
  89. TCloneFunc=function(args:pointer):longint;cdecl;
  90. {
  91. $Log$
  92. Revision 1.2 2004-01-22 13:55:02 marco
  93. * first port that shows some life based on FPC_USE_LIBC
  94. Revision 1.4 2004/01/04 01:11:28 marco
  95. * a new qod port of the freebsd rtl. To be refined in the coming days.
  96. Revision 1.3 2003/01/21 15:39:45 marco
  97. * NetBSD first rtl. Still not 100%, but close
  98. Revision 1.2 2003/01/17 22:13:47 marco
  99. * some updates
  100. Revision 1.1.2.1 2001/08/10 11:07:17 pierre
  101. New NetBSD files taken and adapted from FreeBSD
  102. Revision 1.1.2.3 2001/03/12 14:58:37 marco
  103. * [Solaris] some constants moved from sysunix.inc
  104. Revision 1.1.2.2 2000/11/03 14:58:52 marco
  105. * Open_NoCTTY added. Needed for serial.pp
  106. Revision 1.1.2.1 2000/09/16 11:19:08 marco
  107. * Moved files from BSD to FreeBSD directory, with some small changes
  108. Revision 1.1 2000/07/13 06:30:33 michael
  109. + Initial import
  110. Revision 1.5 2000/04/10 15:46:52 marco
  111. * worked all day. probably a lot changed
  112. Revision 1.3 2000/02/03 17:05:13 marco
  113. * fixes and updates due to linux unit porting
  114. Revision 1.2 2000/02/02 16:35:29 marco
  115. * Checked stat constants
  116. Revision 1.1 2000/02/02 15:41:28 marco
  117. * initial BSD version.
  118. Revision 1.4 2000/01/07 16:41:41 daniel
  119. * copyright 2000
  120. Revision 1.3 2000/01/07 16:32:28 daniel
  121. * copyright 2000 added
  122. Revision 1.2 1998/05/06 12:38:22 michael
  123. + Removed log from before restored version.
  124. Revision 1.1.1.1 1998/03/25 11:18:43 root
  125. * Restored version
  126. }