| .. | .. |
|---|
| 9 | 9 | #include <linux/compiler.h> |
|---|
| 10 | 10 | #include <linux/types.h> |
|---|
| 11 | 11 | #include <linux/posix_types.h> |
|---|
| 12 | +#include <linux/errno.h> |
|---|
| 12 | 13 | |
|---|
| 13 | 14 | struct file; |
|---|
| 14 | 15 | |
|---|
| .. | .. |
|---|
| 16 | 17 | extern void fput_many(struct file *, unsigned int); |
|---|
| 17 | 18 | |
|---|
| 18 | 19 | struct file_operations; |
|---|
| 20 | +struct task_struct; |
|---|
| 19 | 21 | struct vfsmount; |
|---|
| 20 | 22 | struct dentry; |
|---|
| 21 | 23 | struct inode; |
|---|
| .. | .. |
|---|
| 47 | 49 | extern struct file *fget(unsigned int fd); |
|---|
| 48 | 50 | extern struct file *fget_many(unsigned int fd, unsigned int refs); |
|---|
| 49 | 51 | extern struct file *fget_raw(unsigned int fd); |
|---|
| 52 | +extern struct file *fget_task(struct task_struct *task, unsigned int fd); |
|---|
| 50 | 53 | extern unsigned long __fdget(unsigned int fd); |
|---|
| 51 | 54 | extern unsigned long __fdget_raw(unsigned int fd); |
|---|
| 52 | 55 | extern unsigned long __fdget_pos(unsigned int fd); |
|---|
| .. | .. |
|---|
| 83 | 86 | extern int replace_fd(unsigned fd, struct file *file, unsigned flags); |
|---|
| 84 | 87 | extern void set_close_on_exec(unsigned int fd, int flag); |
|---|
| 85 | 88 | extern bool get_close_on_exec(unsigned int fd); |
|---|
| 89 | +extern int __get_unused_fd_flags(unsigned flags, unsigned long nofile); |
|---|
| 86 | 90 | extern int get_unused_fd_flags(unsigned flags); |
|---|
| 87 | 91 | extern void put_unused_fd(unsigned int fd); |
|---|
| 88 | 92 | |
|---|
| 89 | 93 | extern void fd_install(unsigned int fd, struct file *file); |
|---|
| 90 | 94 | |
|---|
| 95 | +extern int __receive_fd(int fd, struct file *file, int __user *ufd, |
|---|
| 96 | + unsigned int o_flags); |
|---|
| 97 | +static inline int receive_fd_user(struct file *file, int __user *ufd, |
|---|
| 98 | + unsigned int o_flags) |
|---|
| 99 | +{ |
|---|
| 100 | + if (ufd == NULL) |
|---|
| 101 | + return -EFAULT; |
|---|
| 102 | + return __receive_fd(-1, file, ufd, o_flags); |
|---|
| 103 | +} |
|---|
| 104 | +static inline int receive_fd(struct file *file, unsigned int o_flags) |
|---|
| 105 | +{ |
|---|
| 106 | + return __receive_fd(-1, file, NULL, o_flags); |
|---|
| 107 | +} |
|---|
| 108 | +static inline int receive_fd_replace(int fd, struct file *file, unsigned int o_flags) |
|---|
| 109 | +{ |
|---|
| 110 | + return __receive_fd(fd, file, NULL, o_flags); |
|---|
| 111 | +} |
|---|
| 112 | + |
|---|
| 91 | 113 | extern void flush_delayed_fput(void); |
|---|
| 92 | 114 | extern void __fput_sync(struct file *); |
|---|
| 93 | 115 | |
|---|
| 116 | +extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max; |
|---|
| 117 | + |
|---|
| 94 | 118 | #endif /* __LINUX_FILE_H */ |
|---|