Sync with cat.c from netbsd-8
[minix3.git] / minix / servers / vfs / const.h
blob21addf66a249e62c7e399dd77d74df973f5c04e3
1 #ifndef __VFS_CONST_H__
2 #define __VFS_CONST_H__
4 /* Tables sizes */
5 #define NR_FILPS 1024 /* # slots in filp table */
6 #define NR_LOCKS 8 /* # slots in the file locking table */
7 #define NR_MNTS 16 /* # slots in mount table */
8 #define NR_VNODES 1024 /* # slots in vnode table */
9 #define NR_WTHREADS 9 /* # slots in worker thread table */
10 #define NR_SOCKDEVS 8 /* # slots in smap table */
12 #define NR_NONEDEVS NR_MNTS /* # slots in nonedev bitmap */
14 /* Miscellaneous constants */
15 #define SU_UID ((uid_t) 0) /* super_user's uid_t */
16 #define SYS_UID ((uid_t) 0) /* uid_t for system processes and INIT */
17 #define SYS_GID ((gid_t) 0) /* gid_t for system processes and INIT */
19 #define FP_BLOCKED_ON_NONE 0 /* not blocked */
20 #define FP_BLOCKED_ON_PIPE 1 /* susp'd on pipe */
21 #define FP_BLOCKED_ON_FLOCK 2 /* susp'd on file lock */
22 #define FP_BLOCKED_ON_POPEN 3 /* susp'd on pipe open */
23 #define FP_BLOCKED_ON_SELECT 4 /* susp'd on select */
24 #define FP_BLOCKED_ON_CDEV 5 /* blocked on character device I/O */
25 #define FP_BLOCKED_ON_SDEV 6 /* blocked on socket I/O */
27 /* test if the process is blocked on something */
28 #define fp_is_blocked(fp) ((fp)->fp_blocked_on != FP_BLOCKED_ON_NONE)
30 #define INVALID_THREAD ((thread_t) -1) /* known-invalid thread ID */
32 #define SYMLOOP 16
34 #define LABEL_MAX 16 /* maximum label size (including '\0'). Should
35 * not be smaller than 16 or bigger than
36 * M_PATH_STRING_MAX.
38 #define FSTYPE_MAX VFS_NAMELEN /* maximum file system type size */
40 /* possible select() operation types; read, write, errors */
41 #define SEL_RD CDEV_OP_RD
42 #define SEL_WR CDEV_OP_WR
43 #define SEL_ERR CDEV_OP_ERR
44 #define SEL_NOTIFY CDEV_NOTIFY /* not a real select operation */
45 /* If these constants diverge, VFS must be extended to perform mapping. */
46 #if (CDEV_OP_RD != SDEV_OP_RD || CDEV_OP_WR != SDEV_OP_WR || \
47 CDEV_OP_ERR != SDEV_OP_ERR || CDEV_NOTIFY != SDEV_NOTIFY)
48 #error "CDEV and SDEV select constants are different"
49 #endif
51 /* special driver endpoint for CTTY_MAJOR; must be able to pass isokendpt() */
52 #define CTTY_ENDPT VFS_PROC_NR
54 #endif