+++ /dev/null
-/*\r
- * Copyright (c) 1982, 1986, 1989, 1993\r
- * The Regents of the University of California. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- * 3. All advertising materials mentioning features or use of this software\r
- * must display the following acknowledgement:\r
- * This product includes software developed by the University of\r
- * California, Berkeley and its contributors.\r
- * 4. Neither the name of the University nor the names of its contributors\r
- * may be used to endorse or promote products derived from this software\r
- * without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- * SUCH DAMAGE.\r
- *\r
- * @(#)file.h 8.3 (Berkeley) 1/9/95\r
- * $Id: file.h,v 1.1.1.1 2006/05/30 06:12:53 hhzhou Exp $\r
- */\r
-\r
-#ifndef _SYS_FILE_H_\r
-#define _SYS_FILE_H_\r
-\r
-#ifndef KERNEL\r
-#include <sys/fcntl.h>\r
-#include <sys/unistd.h>\r
-#endif\r
-\r
-#ifdef KERNEL\r
-#include <sys/queue.h>\r
-\r
-struct proc;\r
-struct uio;\r
-\r
-/*\r
- * Kernel descriptor table.\r
- * One entry for each open kernel vnode and socket.\r
- */\r
-struct file {\r
- LIST_ENTRY(file) f_list;/* list of active files */\r
- short f_flag; /* see fcntl.h */\r
-#define DTYPE_VNODE 1 /* file */\r
-#define DTYPE_SOCKET 2 /* communications endpoint */\r
-#define DTYPE_PIPE 3 /* pipe */\r
-#define DTYPE_FIFO 4 /* fifo (named pipe) */\r
- short f_type; /* descriptor type */\r
- short f_count; /* reference count */\r
- short f_msgcount; /* references from message queue */\r
- struct ucred *f_cred; /* credentials associated with descriptor */\r
- struct fileops {\r
- int (*fo_read) __P((struct file *fp, struct uio *uio,\r
- struct ucred *cred, int flags));\r
- int (*fo_write) __P((struct file *fp, struct uio *uio,\r
- struct ucred *cred, int flags));\r
-#define FOF_OFFSET 1\r
- int (*fo_ioctl) __P((struct file *fp, u_long com,\r
- caddr_t data, struct proc *p));\r
- int (*fo_poll) __P((struct file *fp, int events,\r
- struct ucred *cred, struct proc *p));\r
- int (*fo_close) __P((struct file *fp, struct proc *p));\r
- } *f_ops;\r
- int f_seqcount; /*\r
- * count of sequential accesses -- cleared\r
- * by most seek operations.\r
- */\r
- off_t f_nextread; /*\r
- * offset of next expected read\r
- */\r
- off_t f_offset;\r
- caddr_t f_data; /* vnode or socket */\r
-};\r
-\r
-#ifdef MALLOC_DECLARE\r
-MALLOC_DECLARE(M_FILE);\r
-#endif\r
-\r
-LIST_HEAD(filelist, file);\r
-extern struct filelist filehead; /* head of list of open files */\r
-extern struct fileops vnops;\r
-extern int maxfiles; /* kernel limit on number of open files */\r
-extern int maxfilesperproc; /* per process limit on number of open files */\r
-extern int nfiles; /* actual number of open files */\r
-\r
-#endif /* KERNEL */\r
-\r
-#endif /* !SYS_FILE_H */\r