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:
Pawel Jakub Dawidek
2008-05-26 15:12:47 +00:00
parent 1f406de782
commit 037dab5792
3 changed files with 6 additions and 4 deletions
+1 -2
View File
@@ -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
View File
@@ -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
+2 -1
View File
@@ -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>