xref: /minix3/minix/servers/vfs/const.h (revision e3b8d4bb58a799dc7fd563ac39bf3015762af03b)
1433d6423SLionel Sambuc #ifndef __VFS_CONST_H__
2433d6423SLionel Sambuc #define __VFS_CONST_H__
3433d6423SLionel Sambuc 
4433d6423SLionel Sambuc /* Tables sizes */
5433d6423SLionel Sambuc #define NR_FILPS        1024	/* # slots in filp table */
6433d6423SLionel Sambuc #define NR_LOCKS           8	/* # slots in the file locking table */
7433d6423SLionel Sambuc #define NR_MNTS           16 	/* # slots in mount table */
8433d6423SLionel Sambuc #define NR_VNODES       1024	/* # slots in vnode table */
9433d6423SLionel Sambuc #define NR_WTHREADS	   9	/* # slots in worker thread table */
10*e3b8d4bbSDavid van Moolenbroek #define NR_SOCKDEVS	   8	/* # slots in smap table */
11433d6423SLionel Sambuc 
12433d6423SLionel Sambuc #define NR_NONEDEVS	NR_MNTS	/* # slots in nonedev bitmap */
13433d6423SLionel Sambuc 
14433d6423SLionel Sambuc /* Miscellaneous constants */
15433d6423SLionel Sambuc #define SU_UID 	 ((uid_t) 0)	/* super_user's uid_t */
16433d6423SLionel Sambuc #define SYS_UID  ((uid_t) 0)	/* uid_t for system processes and INIT */
17433d6423SLionel Sambuc #define SYS_GID  ((gid_t) 0)	/* gid_t for system processes and INIT */
18433d6423SLionel Sambuc 
19433d6423SLionel Sambuc #define FP_BLOCKED_ON_NONE	0 /* not blocked */
20433d6423SLionel Sambuc #define FP_BLOCKED_ON_PIPE	1 /* susp'd on pipe */
21232819ddSDavid van Moolenbroek #define FP_BLOCKED_ON_FLOCK	2 /* susp'd on file lock */
22433d6423SLionel Sambuc #define FP_BLOCKED_ON_POPEN	3 /* susp'd on pipe open */
23433d6423SLionel Sambuc #define FP_BLOCKED_ON_SELECT	4 /* susp'd on select */
24232819ddSDavid van Moolenbroek #define FP_BLOCKED_ON_CDEV	5 /* blocked on character device I/O */
25*e3b8d4bbSDavid van Moolenbroek #define FP_BLOCKED_ON_SDEV	6 /* blocked on socket I/O */
26433d6423SLionel Sambuc 
27433d6423SLionel Sambuc /* test if the process is blocked on something */
28433d6423SLionel Sambuc #define fp_is_blocked(fp)	((fp)->fp_blocked_on != FP_BLOCKED_ON_NONE)
29433d6423SLionel Sambuc 
30433d6423SLionel Sambuc #define INVALID_THREAD	((thread_t) -1) 	/* known-invalid thread ID */
31433d6423SLionel Sambuc 
32433d6423SLionel Sambuc #define SYMLOOP		16
33433d6423SLionel Sambuc 
34433d6423SLionel Sambuc #define LABEL_MAX	16	/* maximum label size (including '\0'). Should
35433d6423SLionel Sambuc 				 * not be smaller than 16 or bigger than
36433d6423SLionel Sambuc 				 * M_PATH_STRING_MAX.
37433d6423SLionel Sambuc 				 */
38433d6423SLionel Sambuc #define FSTYPE_MAX	VFS_NAMELEN	/* maximum file system type size */
39433d6423SLionel Sambuc 
40433d6423SLionel Sambuc /* possible select() operation types; read, write, errors */
41433d6423SLionel Sambuc #define SEL_RD		CDEV_OP_RD
42433d6423SLionel Sambuc #define SEL_WR		CDEV_OP_WR
43433d6423SLionel Sambuc #define SEL_ERR		CDEV_OP_ERR
44433d6423SLionel Sambuc #define SEL_NOTIFY	CDEV_NOTIFY /* not a real select operation */
45*e3b8d4bbSDavid van Moolenbroek /* If these constants diverge, VFS must be extended to perform mapping. */
46*e3b8d4bbSDavid van Moolenbroek #if (CDEV_OP_RD != SDEV_OP_RD || CDEV_OP_WR != SDEV_OP_WR || \
47*e3b8d4bbSDavid van Moolenbroek     CDEV_OP_ERR != SDEV_OP_ERR || CDEV_NOTIFY != SDEV_NOTIFY)
48*e3b8d4bbSDavid van Moolenbroek #error "CDEV and SDEV select constants are different"
49*e3b8d4bbSDavid van Moolenbroek #endif
50433d6423SLionel Sambuc 
51433d6423SLionel Sambuc /* special driver endpoint for CTTY_MAJOR; must be able to pass isokendpt() */
52433d6423SLionel Sambuc #define CTTY_ENDPT	VFS_PROC_NR
53433d6423SLionel Sambuc 
54433d6423SLionel Sambuc #endif
55