Lines Matching defs:sock
27 #include <net/sock.h>
141 int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk,
336 static int do_set_attach_filter(struct socket *sock, int level, int optname,
352 return sock_setsockopt(sock, level, optname, (char __user *)kfprog,
356 static int do_set_sock_timeout(struct socket *sock, int level,
372 err = sock_setsockopt(sock, level, optname, (char *)&ktime, sizeof(ktime));
378 static int compat_sock_setsockopt(struct socket *sock, int level, int optname,
382 return do_set_attach_filter(sock, level, optname,
385 return do_set_sock_timeout(sock, level, optname, optval, optlen);
387 return sock_setsockopt(sock, level, optname, optval, optlen);
394 struct socket *sock = sockfd_lookup(fd, &err);
396 if (sock) {
397 err = security_socket_setsockopt(sock, level, optname);
399 sockfd_put(sock);
404 err = compat_sock_setsockopt(sock, level,
406 else if (sock->ops->compat_setsockopt)
407 err = sock->ops->compat_setsockopt(sock, level,
410 err = sock->ops->setsockopt(sock, level,
412 sockfd_put(sock);
417 static int do_get_sock_timeout(struct socket *sock, int level, int optname,
433 err = sock_getsockopt(sock, level, optname, (char *) &ktime, &len);
446 static int compat_sock_getsockopt(struct socket *sock, int level, int optname,
450 return do_get_sock_timeout(sock, level, optname, optval, optlen);
451 return sock_getsockopt(sock, level, optname, optval, optlen);
454 int compat_sock_get_timestamp(struct sock *sk, struct timeval __user *userstamp)
478 int compat_sock_get_timestampns(struct sock *sk, struct timespec __user *userstamp)
506 struct socket *sock = sockfd_lookup(fd, &err);
508 if (sock) {
509 err = security_socket_getsockopt(sock, level, optname);
511 sockfd_put(sock);
516 err = compat_sock_getsockopt(sock, level,
518 else if (sock->ops->compat_getsockopt)
519 err = sock->ops->compat_getsockopt(sock, level,
522 err = sock->ops->getsockopt(sock, level,
524 sockfd_put(sock);
557 int compat_mc_setsockopt(struct sock *sock, int level, int optname,
559 int (*setsockopt)(struct sock *, int, int, char __user *, unsigned int))
640 return setsockopt(sock, level, optname, koptval, koptlen);
644 int compat_mc_getsockopt(struct sock *sock, int level, int optname,
646 int (*getsockopt)(struct sock *, int, int, char __user *, int __user *))
655 return getsockopt(sock, level, optname, optval, optlen);
685 err = getsockopt(sock, level, optname, (char __user *)kgf, koptlen);