UnixTypes.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright notice, this
  9. * list of conditions and the following disclaimer.
  10. *
  11. * 2. Redistributions in binary form must reproduce the above copyright notice,
  12. * this list of conditions and the following disclaimer in the documentation
  13. * and/or other materials provided with the distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  16. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  19. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  21. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  22. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  23. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  24. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. #pragma once
  27. #include <AK/DistinctNumeric.h>
  28. #include <AK/Types.h>
  29. #define O_RDONLY (1 << 0)
  30. #define O_WRONLY (1 << 1)
  31. #define O_RDWR (O_RDONLY | O_WRONLY)
  32. #define O_ACCMODE (O_RDONLY | O_WRONLY)
  33. #define O_EXEC (1 << 2)
  34. #define O_CREAT (1 << 3)
  35. #define O_EXCL (1 << 4)
  36. #define O_NOCTTY (1 << 5)
  37. #define O_TRUNC (1 << 6)
  38. #define O_APPEND (1 << 7)
  39. #define O_NONBLOCK (1 << 8)
  40. #define O_DIRECTORY (1 << 9)
  41. #define O_NOFOLLOW (1 << 10)
  42. #define O_CLOEXEC (1 << 11)
  43. #define O_DIRECT (1 << 12)
  44. // Kernel internal options.
  45. #define O_NOFOLLOW_NOERROR (1 << 29)
  46. #define O_UNLINK_INTERNAL (1 << 30)
  47. #define MS_NODEV (1 << 0)
  48. #define MS_NOEXEC (1 << 1)
  49. #define MS_NOSUID (1 << 2)
  50. #define MS_BIND (1 << 3)
  51. #define MS_RDONLY (1 << 4)
  52. #define MS_REMOUNT (1 << 5)
  53. enum {
  54. _SC_NPROCESSORS_CONF,
  55. _SC_NPROCESSORS_ONLN,
  56. _SC_PAGESIZE,
  57. _SC_OPEN_MAX
  58. };
  59. #define PERF_EVENT_SAMPLE 0
  60. #define PERF_EVENT_MALLOC 1
  61. #define PERF_EVENT_FREE 2
  62. #define WNOHANG 1
  63. #define WUNTRACED 2
  64. #define WSTOPPED WUNTRACED
  65. #define WEXITED 4
  66. #define WCONTINUED 8
  67. #define WNOWAIT 0x1000000
  68. #define R_OK 4
  69. #define W_OK 2
  70. #define X_OK 1
  71. #define F_OK 0
  72. #define SIG_DFL ((void*)0)
  73. #define SIG_ERR ((void*)-1)
  74. #define SIG_IGN ((void*)1)
  75. #define SEEK_SET 0
  76. #define SEEK_CUR 1
  77. #define SEEK_END 2
  78. #define MAP_SHARED 0x01
  79. #define MAP_PRIVATE 0x02
  80. #define MAP_FIXED 0x10
  81. #define MAP_ANONYMOUS 0x20
  82. #define MAP_ANON MAP_ANONYMOUS
  83. #define MAP_STACK 0x40
  84. #define MAP_NORESERVE 0x80
  85. #define PROT_READ 0x1
  86. #define PROT_WRITE 0x2
  87. #define PROT_EXEC 0x4
  88. #define PROT_NONE 0x0
  89. #define MADV_SET_VOLATILE 0x100
  90. #define MADV_SET_NONVOLATILE 0x200
  91. #define MADV_GET_VOLATILE 0x400
  92. #define F_DUPFD 0
  93. #define F_GETFD 1
  94. #define F_SETFD 2
  95. #define F_GETFL 3
  96. #define F_SETFL 4
  97. #define F_ISTTY 5
  98. #define FD_CLOEXEC 1
  99. #define FUTEX_WAIT 1
  100. #define FUTEX_WAKE 2
  101. #define S_IFMT 0170000
  102. #define S_IFDIR 0040000
  103. #define S_IFCHR 0020000
  104. #define S_IFBLK 0060000
  105. #define S_IFREG 0100000
  106. #define S_IFIFO 0010000
  107. #define S_IFLNK 0120000
  108. #define S_IFSOCK 0140000
  109. #define S_ISUID 04000
  110. #define S_ISGID 02000
  111. #define S_ISVTX 01000
  112. #define S_IRUSR 0400
  113. #define S_IWUSR 0200
  114. #define S_IXUSR 0100
  115. #define S_IRGRP 0040
  116. #define S_IWGRP 0020
  117. #define S_IXGRP 0010
  118. #define S_IROTH 0004
  119. #define S_IWOTH 0002
  120. #define S_IXOTH 0001
  121. /* c_cc characters */
  122. #define VINTR 0
  123. #define VQUIT 1
  124. #define VERASE 2
  125. #define VKILL 3
  126. #define VEOF 4
  127. #define VTIME 5
  128. #define VMIN 6
  129. #define VSWTC 7
  130. #define VSTART 8
  131. #define VSTOP 9
  132. #define VSUSP 10
  133. #define VEOL 11
  134. #define VREPRINT 12
  135. #define VDISCARD 13
  136. #define VWERASE 14
  137. #define VLNEXT 15
  138. #define VEOL2 16
  139. #define VINFO 17
  140. /* c_iflag bits */
  141. #define IGNBRK 0000001
  142. #define BRKINT 0000002
  143. #define IGNPAR 0000004
  144. #define PARMRK 0000010
  145. #define INPCK 0000020
  146. #define ISTRIP 0000040
  147. #define INLCR 0000100
  148. #define IGNCR 0000200
  149. #define ICRNL 0000400
  150. #define IUCLC 0001000
  151. #define IXON 0002000
  152. #define IXANY 0004000
  153. #define IXOFF 0010000
  154. #define IMAXBEL 0020000
  155. #define IUTF8 0040000
  156. /* c_oflag bits */
  157. #define OPOST 0000001
  158. #define OLCUC 0000002
  159. #define ONLCR 0000004
  160. #define OCRNL 0000010
  161. #define ONOCR 0000020
  162. #define ONLRET 0000040
  163. #define OFILL 0000100
  164. #define OFDEL 0000200
  165. #if defined __USE_MISC || defined __USE_XOPEN
  166. # define NLDLY 0000400
  167. # define NL0 0000000
  168. # define NL1 0000400
  169. # define CRDLY 0003000
  170. # define CR0 0000000
  171. # define CR1 0001000
  172. # define CR2 0002000
  173. # define CR3 0003000
  174. # define TABDLY 0014000
  175. # define TAB0 0000000
  176. # define TAB1 0004000
  177. # define TAB2 0010000
  178. # define TAB3 0014000
  179. # define BSDLY 0020000
  180. # define BS0 0000000
  181. # define BS1 0020000
  182. # define FFDLY 0100000
  183. # define FF0 0000000
  184. # define FF1 0100000
  185. #endif
  186. #define VTDLY 0040000
  187. #define VT0 0000000
  188. #define VT1 0040000
  189. #ifdef __USE_MISC
  190. # define XTABS 0014000
  191. #endif
  192. /* c_cflag bit meaning */
  193. #ifdef __USE_MISC
  194. # define CBAUD 0010017
  195. #endif
  196. #define B0 0000000 /* hang up */
  197. #define B50 0000001
  198. #define B75 0000002
  199. #define B110 0000003
  200. #define B134 0000004
  201. #define B150 0000005
  202. #define B200 0000006
  203. #define B300 0000007
  204. #define B600 0000010
  205. #define B1200 0000011
  206. #define B1800 0000012
  207. #define B2400 0000013
  208. #define B4800 0000014
  209. #define B9600 0000015
  210. #define B19200 0000016
  211. #define B38400 0000017
  212. #ifdef __USE_MISC
  213. # define EXTA B19200
  214. # define EXTB B38400
  215. #endif
  216. #define CSIZE 0000060
  217. #define CS5 0000000
  218. #define CS6 0000020
  219. #define CS7 0000040
  220. #define CS8 0000060
  221. #define CSTOPB 0000100
  222. #define CREAD 0000200
  223. #define PARENB 0000400
  224. #define PARODD 0001000
  225. #define HUPCL 0002000
  226. #define CLOCAL 0004000
  227. #ifdef __USE_MISC
  228. # define CBAUDEX 0010000
  229. #endif
  230. #define B57600 0010001
  231. #define B115200 0010002
  232. #define B230400 0010003
  233. #define B460800 0010004
  234. #define B500000 0010005
  235. #define B576000 0010006
  236. #define B921600 0010007
  237. #define B1000000 0010010
  238. #define B1152000 0010011
  239. #define B1500000 0010012
  240. #define B2000000 0010013
  241. #define B2500000 0010014
  242. #define B3000000 0010015
  243. #define B3500000 0010016
  244. #define B4000000 0010017
  245. #define __MAX_BAUD B4000000
  246. #ifdef __USE_MISC
  247. # define CIBAUD 002003600000 /* input baud rate (not used) */
  248. # define CMSPAR 010000000000 /* mark or space (stick) parity */
  249. # define CRTSCTS 020000000000 /* flow control */
  250. #endif
  251. /* c_lflag bits */
  252. #define ISIG 0000001
  253. #define ICANON 0000002
  254. #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
  255. # define XCASE 0000004
  256. #endif
  257. #define ECHO 0000010
  258. #define ECHOE 0000020
  259. #define ECHOK 0000040
  260. #define ECHONL 0000100
  261. #define NOFLSH 0000200
  262. #define TOSTOP 0000400
  263. #ifdef __USE_MISC
  264. # define ECHOCTL 0001000
  265. # define ECHOPRT 0002000
  266. # define ECHOKE 0004000
  267. # define FLUSHO 0010000
  268. # define PENDIN 0040000
  269. #endif
  270. #define IEXTEN 0100000
  271. #ifdef __USE_MISC
  272. # define EXTPROC 0200000
  273. #endif
  274. /* tcflow() and TCXONC use these */
  275. #define TCOOFF 0
  276. #define TCOON 1
  277. #define TCIOFF 2
  278. #define TCION 3
  279. /* tcflush() and TCFLSH use these */
  280. #define TCIFLUSH 0
  281. #define TCOFLUSH 1
  282. #define TCIOFLUSH 2
  283. /* tcsetattr uses these */
  284. #define TCSANOW 0
  285. #define TCSADRAIN 1
  286. #define TCSAFLUSH 2
  287. typedef u32 dev_t;
  288. typedef u32 ino_t;
  289. typedef u16 mode_t;
  290. typedef u32 nlink_t;
  291. typedef u32 uid_t;
  292. typedef u32 gid_t;
  293. typedef u32 clock_t;
  294. typedef u32 socklen_t;
  295. typedef int pid_t;
  296. // Avoid interference with AK/Types.h and LibC/sys/types.h by defining *separate* names:
  297. TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessID);
  298. TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ThreadID);
  299. TYPEDEF_DISTINCT_ORDERED_ID(pid_t, SessionID);
  300. TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessGroupID);
  301. struct tms {
  302. clock_t tms_utime;
  303. clock_t tms_stime;
  304. clock_t tms_cutime;
  305. clock_t tms_cstime;
  306. };
  307. typedef void (*__sighandler_t)(int);
  308. typedef __sighandler_t sighandler_t;
  309. typedef u32 sigset_t;
  310. union sigval {
  311. int sival_int;
  312. void* sival_ptr;
  313. };
  314. typedef struct siginfo {
  315. int si_signo;
  316. int si_code;
  317. pid_t si_pid;
  318. uid_t si_uid;
  319. void* si_addr;
  320. int si_status;
  321. union sigval si_value;
  322. } siginfo_t;
  323. struct sigaction {
  324. union {
  325. void (*sa_handler)(int);
  326. void (*sa_sigaction)(int, siginfo_t*, void*);
  327. };
  328. sigset_t sa_mask;
  329. int sa_flags;
  330. };
  331. #define SA_NOCLDSTOP 1
  332. #define SA_NOCLDWAIT 2
  333. #define SA_SIGINFO 4
  334. #define SA_NODEFER 0x40000000
  335. #define SIG_BLOCK 0
  336. #define SIG_UNBLOCK 1
  337. #define SIG_SETMASK 2
  338. #define CLD_EXITED 0
  339. #define CLD_KILLED 1
  340. #define CLD_DUMPED 2
  341. #define CLD_TRAPPED 3
  342. #define CLD_STOPPED 4
  343. #define CLD_CONTINUED 5
  344. #define OFF_T_MAX 2147483647
  345. typedef ssize_t off_t;
  346. typedef i64 time_t;
  347. struct utimbuf {
  348. time_t actime;
  349. time_t modtime;
  350. };
  351. typedef u32 blksize_t;
  352. typedef u32 blkcnt_t;
  353. #define NCCS 32
  354. typedef uint32_t tcflag_t;
  355. typedef uint8_t cc_t;
  356. typedef uint32_t speed_t;
  357. struct termios {
  358. tcflag_t c_iflag;
  359. tcflag_t c_oflag;
  360. tcflag_t c_cflag;
  361. tcflag_t c_lflag;
  362. cc_t c_cc[NCCS];
  363. speed_t c_ispeed;
  364. speed_t c_ospeed;
  365. };
  366. struct stat {
  367. dev_t st_dev; /* ID of device containing file */
  368. ino_t st_ino; /* inode number */
  369. mode_t st_mode; /* protection */
  370. nlink_t st_nlink; /* number of hard links */
  371. uid_t st_uid; /* user ID of owner */
  372. gid_t st_gid; /* group ID of owner */
  373. dev_t st_rdev; /* device ID (if special file) */
  374. off_t st_size; /* total size, in bytes */
  375. blksize_t st_blksize; /* blocksize for file system I/O */
  376. blkcnt_t st_blocks; /* number of 512B blocks allocated */
  377. time_t st_atime; /* time of last access */
  378. time_t st_mtime; /* time of last modification */
  379. time_t st_ctime; /* time of last status change */
  380. };
  381. #define POLLIN (1u << 0)
  382. #define POLLPRI (1u << 1)
  383. #define POLLOUT (1u << 2)
  384. #define POLLERR (1u << 3)
  385. #define POLLHUP (1u << 4)
  386. #define POLLNVAL (1u << 5)
  387. #define POLLRDHUP (1u << 13)
  388. struct pollfd {
  389. int fd;
  390. short events;
  391. short revents;
  392. };
  393. #define AF_MASK 0xff
  394. #define AF_UNSPEC 0
  395. #define AF_LOCAL 1
  396. #define AF_INET 2
  397. #define AF_MAX 3
  398. #define PF_LOCAL AF_LOCAL
  399. #define PF_INET AF_INET
  400. #define SOCK_TYPE_MASK 0xff
  401. #define SOCK_STREAM 1
  402. #define SOCK_RAW 3
  403. #define SOCK_DGRAM 2
  404. #define SOCK_NONBLOCK 04000
  405. #define SOCK_CLOEXEC 02000000
  406. #define SHUT_RD 1
  407. #define SHUT_WR 2
  408. #define SHUT_RDWR 3
  409. #define MSG_TRUNC 0x1
  410. #define MSG_CTRUNC 0x2
  411. #define MSG_DONTWAIT 0x40
  412. #define SOL_SOCKET 1
  413. enum {
  414. SO_RCVTIMEO,
  415. SO_SNDTIMEO,
  416. SO_TYPE,
  417. SO_ERROR,
  418. SO_PEERCRED,
  419. SO_REUSEADDR,
  420. SO_BINDTODEVICE,
  421. SO_KEEPALIVE,
  422. SO_TIMESTAMP,
  423. };
  424. enum {
  425. SCM_TIMESTAMP,
  426. };
  427. #define IPPROTO_IP 0
  428. #define IPPROTO_ICMP 1
  429. #define IPPROTO_TCP 6
  430. #define IPPROTO_UDP 17
  431. #define IP_TTL 2
  432. struct ucred {
  433. pid_t pid;
  434. uid_t uid;
  435. gid_t gid;
  436. };
  437. struct sockaddr {
  438. u16 sa_family;
  439. char sa_data[14];
  440. };
  441. #define S_IFSOCK 0140000
  442. #define UNIX_PATH_MAX 108
  443. struct sockaddr_un {
  444. u16 sun_family;
  445. char sun_path[UNIX_PATH_MAX];
  446. };
  447. struct in_addr {
  448. uint32_t s_addr;
  449. };
  450. struct sockaddr_in {
  451. int16_t sin_family;
  452. uint16_t sin_port;
  453. struct in_addr sin_addr;
  454. char sin_zero[8];
  455. };
  456. typedef u32 __u32;
  457. typedef u16 __u16;
  458. typedef u8 __u8;
  459. typedef int __s32;
  460. typedef short __s16;
  461. typedef u32 useconds_t;
  462. typedef i32 suseconds_t;
  463. struct timeval {
  464. time_t tv_sec;
  465. suseconds_t tv_usec;
  466. };
  467. struct timespec {
  468. time_t tv_sec;
  469. long tv_nsec;
  470. };
  471. typedef enum {
  472. P_ALL = 1,
  473. P_PID,
  474. P_PGID
  475. } idtype_t;
  476. typedef int clockid_t;
  477. #define CLOCK_REALTIME 0
  478. #define CLOCK_MONOTONIC 1
  479. #define CLOCK_MONOTONIC_RAW 4
  480. #define CLOCK_REALTIME_COARSE 5
  481. #define CLOCK_MONOTONIC_COARSE 6
  482. #define TIMER_ABSTIME 99
  483. #define UTSNAME_ENTRY_LEN 65
  484. struct utsname {
  485. char sysname[UTSNAME_ENTRY_LEN];
  486. char nodename[UTSNAME_ENTRY_LEN];
  487. char release[UTSNAME_ENTRY_LEN];
  488. char version[UTSNAME_ENTRY_LEN];
  489. char machine[UTSNAME_ENTRY_LEN];
  490. };
  491. struct iovec {
  492. void* iov_base;
  493. size_t iov_len;
  494. };
  495. struct cmsghdr {
  496. socklen_t cmsg_len;
  497. int cmsg_level;
  498. int cmsg_type;
  499. };
  500. struct msghdr {
  501. void* msg_name;
  502. socklen_t msg_namelen;
  503. struct iovec* msg_iov;
  504. int msg_iovlen;
  505. void* msg_control;
  506. socklen_t msg_controllen;
  507. int msg_flags;
  508. };
  509. struct sched_param {
  510. int sched_priority;
  511. };
  512. struct ifreq {
  513. #define IFNAMSIZ 16
  514. char ifr_name[IFNAMSIZ];
  515. union {
  516. struct sockaddr ifru_addr;
  517. struct sockaddr ifru_dstaddr;
  518. struct sockaddr ifru_broadaddr;
  519. struct sockaddr ifru_netmask;
  520. struct sockaddr ifru_hwaddr;
  521. short ifru_flags;
  522. int ifru_metric;
  523. int64_t ifru_vnetid;
  524. uint64_t ifru_media;
  525. void* ifru_data;
  526. unsigned int ifru_index;
  527. } ifr_ifru;
  528. // clang-format off
  529. #define ifr_addr ifr_ifru.ifru_addr // address
  530. #define ifr_dstaddr ifr_ifru.ifru_dstaddr // other end of p-to-p link
  531. #define ifr_broadaddr ifr_ifru.ifru_broadaddr // broadcast address
  532. #define ifr_netmask ifr_ifru.ifru_netmask // network mask
  533. #define ifr_flags ifr_ifru.ifru_flags // flags
  534. #define ifr_metric ifr_ifru.ifru_metric // metric
  535. #define ifr_mtu ifr_ifru.ifru_metric // mtu (overload)
  536. #define ifr_hardmtu ifr_ifru.ifru_metric // hardmtu (overload)
  537. #define ifr_media ifr_ifru.ifru_media // media options
  538. #define ifr_rdomainid ifr_ifru.ifru_metric // VRF instance (overload)
  539. #define ifr_vnetid ifr_ifru.ifru_vnetid // Virtual Net Id
  540. #define ifr_ttl ifr_ifru.ifru_metric // tunnel TTL (overload)
  541. #define ifr_data ifr_ifru.ifru_data // for use by interface
  542. #define ifr_index ifr_ifru.ifru_index // interface index
  543. #define ifr_llprio ifr_ifru.ifru_metric // link layer priority
  544. #define ifr_hwaddr ifr_ifru.ifru_hwaddr // MAC address
  545. // clang-format on
  546. };
  547. struct rtentry {
  548. struct sockaddr rt_gateway; /* the gateway address */
  549. struct sockaddr rt_genmask; /* the target network mask */
  550. unsigned short int rt_flags;
  551. char* rt_dev;
  552. /* FIXME: complete the struct */
  553. };
  554. #define RTF_UP 0x1 /* do not delete the route */
  555. #define RTF_GATEWAY 0x2 /* the route is a gateway and not an end host */
  556. #define AT_FDCWD -100
  557. #define PURGE_ALL_VOLATILE 0x1
  558. #define PURGE_ALL_CLEAN_INODE 0x2
  559. #define PT_TRACE_ME 1
  560. #define PT_ATTACH 2
  561. #define PT_CONTINUE 3
  562. #define PT_SYSCALL 4
  563. #define PT_GETREGS 5
  564. #define PT_DETACH 6
  565. #define PT_PEEK 7
  566. #define PT_POKE 8
  567. #define PT_SETREGS 9
  568. // Used in struct dirent
  569. enum {
  570. DT_UNKNOWN = 0,
  571. #define DT_UNKNOWN DT_UNKNOWN
  572. DT_FIFO = 1,
  573. #define DT_FIFO DT_FIFO
  574. DT_CHR = 2,
  575. #define DT_CHR DT_CHR
  576. DT_DIR = 4,
  577. #define DT_DIR DT_DIR
  578. DT_BLK = 6,
  579. #define DT_BLK DT_BLK
  580. DT_REG = 8,
  581. #define DT_REG DT_REG
  582. DT_LNK = 10,
  583. #define DT_LNK DT_LNK
  584. DT_SOCK = 12,
  585. #define DT_SOCK DT_SOCK
  586. DT_WHT = 14
  587. #define DT_WHT DT_WHT
  588. };