Lines Matching refs:fd
124 static int sock_fasync(int fd, struct file *filp, int on);
415 int fd = get_unused_fd_flags(flags); in sock_map_fd() local
416 if (unlikely(fd < 0)) { in sock_map_fd()
418 return fd; in sock_map_fd()
423 fd_install(fd, newfile); in sock_map_fd()
424 return fd; in sock_map_fd()
427 put_unused_fd(fd); in sock_map_fd()
462 struct socket *sockfd_lookup(int fd, int *err) in sockfd_lookup() argument
467 file = fget(fd); in sockfd_lookup()
480 static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed) in sockfd_lookup_light() argument
482 struct fd f = fdget(fd); in sockfd_lookup_light()
1284 static int sock_fasync(int fd, struct file *filp, int on) in sock_fasync() argument
1294 fasync_helper(fd, filp, on, &wq->fasync_list); in sock_fasync()
1634 int __sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) in __sys_bind() argument
1640 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_bind()
1657 SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) in SYSCALL_DEFINE3() argument
1659 return __sys_bind(fd, umyaddr, addrlen); in SYSCALL_DEFINE3()
1668 int __sys_listen(int fd, int backlog) in __sys_listen() argument
1674 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_listen()
1689 SYSCALL_DEFINE2(listen, int, fd, int, backlog) in SYSCALL_DEFINE2() argument
1691 return __sys_listen(fd, backlog); in SYSCALL_DEFINE2()
1706 int __sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, in __sys_accept4() argument
1720 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_accept4()
1787 SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, in SYSCALL_DEFINE4() argument
1790 return __sys_accept4(fd, upeer_sockaddr, upeer_addrlen, flags); in SYSCALL_DEFINE4()
1793 SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr, in SYSCALL_DEFINE3() argument
1796 return __sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0); in SYSCALL_DEFINE3()
1811 int __sys_connect(int fd, struct sockaddr __user *uservaddr, int addrlen) in __sys_connect() argument
1817 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_connect()
1837 SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, in SYSCALL_DEFINE3() argument
1840 return __sys_connect(fd, uservaddr, addrlen); in SYSCALL_DEFINE3()
1848 int __sys_getsockname(int fd, struct sockaddr __user *usockaddr, in __sys_getsockname() argument
1855 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_getsockname()
1875 SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr, in SYSCALL_DEFINE3() argument
1878 return __sys_getsockname(fd, usockaddr, usockaddr_len); in SYSCALL_DEFINE3()
1886 int __sys_getpeername(int fd, struct sockaddr __user *usockaddr, in __sys_getpeername() argument
1893 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_getpeername()
1911 SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr, in SYSCALL_DEFINE3() argument
1914 return __sys_getpeername(fd, usockaddr, usockaddr_len); in SYSCALL_DEFINE3()
1922 int __sys_sendto(int fd, void __user *buff, size_t len, unsigned int flags, in __sys_sendto() argument
1935 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_sendto()
1961 SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, in SYSCALL_DEFINE6() argument
1965 return __sys_sendto(fd, buff, len, flags, addr, addr_len); in SYSCALL_DEFINE6()
1972 SYSCALL_DEFINE4(send, int, fd, void __user *, buff, size_t, len, in SYSCALL_DEFINE4() argument
1975 return __sys_sendto(fd, buff, len, flags, NULL, 0); in SYSCALL_DEFINE4()
1983 int __sys_recvfrom(int fd, void __user *ubuf, size_t size, unsigned int flags, in __sys_recvfrom() argument
1996 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_recvfrom()
2024 SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, in SYSCALL_DEFINE6() argument
2028 return __sys_recvfrom(fd, ubuf, size, flags, addr, addr_len); in SYSCALL_DEFINE6()
2035 SYSCALL_DEFINE4(recv, int, fd, void __user *, ubuf, size_t, size, in SYSCALL_DEFINE4() argument
2038 return __sys_recvfrom(fd, ubuf, size, flags, NULL, NULL); in SYSCALL_DEFINE4()
2046 static int __sys_setsockopt(int fd, int level, int optname, in __sys_setsockopt() argument
2057 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_setsockopt()
2098 SYSCALL_DEFINE5(setsockopt, int, fd, int, level, int, optname, in SYSCALL_DEFINE5() argument
2101 return __sys_setsockopt(fd, level, optname, optval, optlen); in SYSCALL_DEFINE5()
2109 static int __sys_getsockopt(int fd, int level, int optname, in __sys_getsockopt() argument
2116 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_getsockopt()
2142 SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname, in SYSCALL_DEFINE5() argument
2145 return __sys_getsockopt(fd, level, optname, optval, optlen); in SYSCALL_DEFINE5()
2152 int __sys_shutdown(int fd, int how) in __sys_shutdown() argument
2157 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_shutdown()
2167 SYSCALL_DEFINE2(shutdown, int, fd, int, how) in SYSCALL_DEFINE2() argument
2169 return __sys_shutdown(fd, how); in SYSCALL_DEFINE2()
2384 long __sys_sendmsg(int fd, struct user_msghdr __user *msg, unsigned int flags, in __sys_sendmsg() argument
2394 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_sendmsg()
2405 SYSCALL_DEFINE3(sendmsg, int, fd, struct user_msghdr __user *, msg, unsigned int, flags) in SYSCALL_DEFINE3() argument
2407 return __sys_sendmsg(fd, msg, flags, true); in SYSCALL_DEFINE3()
2414 int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, in __sys_sendmmsg() argument
2433 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_sendmmsg()
2481 SYSCALL_DEFINE4(sendmmsg, int, fd, struct mmsghdr __user *, mmsg, in SYSCALL_DEFINE4() argument
2484 return __sys_sendmmsg(fd, mmsg, vlen, flags, true); in SYSCALL_DEFINE4()
2604 long __sys_recvmsg(int fd, struct user_msghdr __user *msg, unsigned int flags, in __sys_recvmsg() argument
2614 sock = sockfd_lookup_light(fd, &err, &fput_needed); in __sys_recvmsg()
2625 SYSCALL_DEFINE3(recvmsg, int, fd, struct user_msghdr __user *, msg, in SYSCALL_DEFINE3() argument
2628 return __sys_recvmsg(fd, msg, flags, true); in SYSCALL_DEFINE3()
2635 static int do_recvmmsg(int fd, struct mmsghdr __user *mmsg, in do_recvmmsg() argument
2654 sock = sockfd_lookup_light(fd, &err, &fput_needed); in do_recvmmsg()
2746 int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, in __sys_recvmmsg() argument
2761 return do_recvmmsg(fd, mmsg, vlen, flags, NULL); in __sys_recvmmsg()
2763 datagrams = do_recvmmsg(fd, mmsg, vlen, flags, &timeout_sys); in __sys_recvmmsg()
2777 SYSCALL_DEFINE5(recvmmsg, int, fd, struct mmsghdr __user *, mmsg, in SYSCALL_DEFINE5() argument
2784 return __sys_recvmmsg(fd, mmsg, vlen, flags, timeout, NULL); in SYSCALL_DEFINE5()
2788 SYSCALL_DEFINE5(recvmmsg_time32, int, fd, struct mmsghdr __user *, mmsg, in SYSCALL_DEFINE5() argument
2795 return __sys_recvmmsg(fd, mmsg, vlen, flags, NULL, timeout); in SYSCALL_DEFINE5()