1 /* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * All rights reserved. 5 * 6 * This code is derived from software donated to Berkeley by 7 * Jan-Simon Pendry. 8 * 9 * %sccs.include.redist.c% 10 * 11 * @(#)fdesc.h 8.2 (Berkeley) 01/04/94 12 * 13 * $Id: fdesc.h,v 1.8 1993/04/06 15:28:33 jsp Exp $ 14 */ 15 16 #ifdef KERNEL 17 18 #ifndef VT_FDESC 19 #define VT_FDESC VT_UFS 20 #endif 21 22 struct fdescmount { 23 struct vnode *f_root; /* Root node */ 24 }; 25 26 #define FD_ROOT 2 27 #define FD_DEVFD 3 28 #define FD_STDIN 4 29 #define FD_STDOUT 5 30 #define FD_STDERR 6 31 #define FD_CTTY 7 32 #define FD_DESC 8 33 #define FD_MAX 12 34 35 typedef enum { 36 Froot, 37 Fdevfd, 38 Fdesc, 39 Flink, 40 Fctty 41 } fdntype; 42 43 struct fdescnode { 44 fdntype fd_type; /* Type of this node */ 45 unsigned fd_fd; /* Fd to be dup'ed */ 46 char *fd_link; /* Link to fd/n */ 47 int fd_ix; /* filesystem index */ 48 }; 49 50 #define VFSTOFDESC(mp) ((struct fdescmount *)((mp)->mnt_data)) 51 #define VTOFDESC(vp) ((struct fdescnode *)(vp)->v_data) 52 53 extern dev_t devctty; 54 extern int fdesc_allocvp __P((fdntype, int, struct mount *, struct vnode **)); 55 extern int (**fdesc_vnodeop_p)(); 56 extern struct vfsops fdesc_vfsops; 57 #endif /* KERNEL */ 58