mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
[PATCH] merge locate_fd() and get_unused_fd()
New primitive: alloc_fd(start, flags). get_unused_fd() and get_unused_fd_flags() become wrappers on top of it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
a1bc6eb4b4
commit
1027abe882
4 changed files with 76 additions and 129 deletions
|
@ -34,8 +34,9 @@ extern struct file *fget(unsigned int fd);
|
|||
extern struct file *fget_light(unsigned int fd, int *fput_needed);
|
||||
extern void set_close_on_exec(unsigned int fd, int flag);
|
||||
extern void put_filp(struct file *);
|
||||
extern int alloc_fd(unsigned start, unsigned flags);
|
||||
extern int get_unused_fd(void);
|
||||
extern int get_unused_fd_flags(int flags);
|
||||
#define get_unused_fd_flags(flags) alloc_fd(0, (flags))
|
||||
extern void put_unused_fd(unsigned int fd);
|
||||
|
||||
extern void fd_install(unsigned int fd, struct file *file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue