Use _WANT_FILE to make struct file visible from userland. This is
similar to _WANT_UCRED and _WANT_PRISON and seems to be much nicer than defining _KERNEL. It is also needed for my sys/refcount.h change going in soon.
This commit is contained in:
@@ -46,9 +46,8 @@ static char sccsid[] = "@(#)kvm_file.c 8.1 (Berkeley) 6/4/93";
|
||||
#include <sys/param.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/proc.h>
|
||||
#define _KERNEL
|
||||
#define _WANT_FILE /* make file.h give us 'struct file' */
|
||||
#include <sys/file.h>
|
||||
#undef _KERNEL
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <nlist.h>
|
||||
|
||||
+3
-1
@@ -97,7 +97,9 @@ struct fileops {
|
||||
|
||||
#define DFLAG_PASSABLE 0x01 /* may be passed via unix sockets. */
|
||||
#define DFLAG_SEEKABLE 0x02 /* seekable / nonsequential */
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#if defined(_KERNEL) || defined(_WANT_FILE)
|
||||
/*
|
||||
* Kernel descriptor table.
|
||||
* One entry for each open kernel vnode and socket.
|
||||
@@ -137,7 +139,7 @@ struct file {
|
||||
#define FOFFSET_LOCKED 0x1
|
||||
#define FOFFSET_LOCK_WAITING 0x2
|
||||
|
||||
#endif /* _KERNEL */
|
||||
#endif /* _KERNEL || _WANT_FILE */
|
||||
|
||||
/*
|
||||
* Userland version of struct file, for sysctl
|
||||
|
||||
@@ -60,10 +60,11 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/queue.h>
|
||||
#define _WANT_FILE
|
||||
#include <sys/file.h>
|
||||
#define _KERNEL
|
||||
#include <sys/pipe.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/mount.h>
|
||||
#include <ufs/ufs/quota.h>
|
||||
#include <ufs/ufs/inode.h>
|
||||
|
||||
Reference in New Issue
Block a user