diff options
author | Jens Axboe <axboe@kernel.dk> | 2022-04-12 14:22:39 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-24 18:19:21 -0600 |
commit | da214a475f8bd1d3e9e7a19ddfeb4d1617551bab (patch) | |
tree | 8f75ac52167355b8b5511ace9f176fca14d64d7e /include/linux/socket.h | |
parent | 0200ce6a57c5de802f4e438485c14cc9d63d5f4b (diff) |
net: add __sys_socket_file()
This works like __sys_socket(), except instead of allocating and
returning a socket fd, it just returns the file associated with the
socket. No fd is installed into the process file table.
This is similar to do_accept(), and allows io_uring to use this without
instantiating a file descriptor in the process file table.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Acked-by: David S. Miller <davem@davemloft.net>
Link: https://lore.kernel.org/r/20220412202240.234207-2-axboe@kernel.dk
Diffstat (limited to 'include/linux/socket.h')
-rw-r--r-- | include/linux/socket.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h index 6f85f5d957ef..a1882e1e71d2 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -434,6 +434,7 @@ extern struct file *do_accept(struct file *file, unsigned file_flags, extern int __sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, int __user *upeer_addrlen, int flags); extern int __sys_socket(int family, int type, int protocol); +extern struct file *__sys_socket_file(int family, int type, int protocol); extern int __sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen); extern int __sys_connect_file(struct file *file, struct sockaddr_storage *addr, int addrlen, int file_flags); |