#include <sys/sysproto.h>
#include <sys/conf.h>
#include <sys/device.h>
+#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
.d_open = fdopen,
};
-static int badfo_readwrite (struct file *fp, struct uio *uio,
- struct ucred *cred, int flags);
-static int badfo_ioctl (struct file *fp, u_long com, caddr_t data,
- struct ucred *cred, struct sysmsg *msg);
-static int badfo_poll (struct file *fp, int events, struct ucred *cred);
-static int badfo_kqfilter (struct file *fp, struct knote *kn);
-static int badfo_stat (struct file *fp, struct stat *sb, struct ucred *cred);
-static int badfo_close (struct file *fp);
-static int badfo_shutdown (struct file *fp, int how);
-
/*
* Descriptor management.
*/
/*
* MPSAFE
*/
-static int
+int
badfo_readwrite(
struct file *fp,
struct uio *uio,
/*
* MPSAFE
*/
-static int
+int
badfo_ioctl(struct file *fp, u_long com, caddr_t data,
struct ucred *cred, struct sysmsg *msgv)
{
/*
* MPSAFE
*/
-static int
+int
badfo_poll(struct file *fp, int events, struct ucred *cred)
{
return (0);
/*
* MPSAFE
*/
-static int
+int
badfo_kqfilter(struct file *fp, struct knote *kn)
{
return (0);
}
-static int
+int
badfo_stat(struct file *fp, struct stat *sb, struct ucred *cred)
{
return (EBADF);
/*
* MPSAFE
*/
-static int
+int
badfo_close(struct file *fp)
{
return (EBADF);
/*
* MPSAFE
*/
-static int
+int
badfo_shutdown(struct file *fp, int how)
{
return (EBADF);
extern int maxfilesrootres; /* descriptors reserved for root use */
extern int maxfilesperproc; /* per process limit on number of open files */
+/* Commonly used fileops */
+int badfo_readwrite(struct file *fp, struct uio *uio,
+ struct ucred *cred, int flags);
+int badfo_ioctl(struct file *fp, u_long com, caddr_t data,
+ struct ucred *cred, struct sysmsg *msg);
+int badfo_poll (struct file *fp, int events, struct ucred *cred);
+int badfo_kqfilter(struct file *fp, struct knote *kn);
+int badfo_stat(struct file *fp, struct stat *sb, struct ucred *cred);
+int badfo_close(struct file *fp);
+int badfo_shutdown(struct file *fp, int how);
+
#endif /* _KERNEL */
#endif /* !SYS_FILE_H */