diff options
-rw-r--r-- | include/linux/net.h | 3 | ||||
-rw-r--r-- | net/socket.c | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index 3a9b06d4d0fe..39a23af059b4 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -102,6 +102,9 @@ enum sock_type { | |||
102 | 102 | ||
103 | /* Flags for socket, socketpair, paccept */ | 103 | /* Flags for socket, socketpair, paccept */ |
104 | #define SOCK_CLOEXEC O_CLOEXEC | 104 | #define SOCK_CLOEXEC O_CLOEXEC |
105 | #ifndef SOCK_NONBLOCK | ||
106 | #define SOCK_NONBLOCK O_NONBLOCK | ||
107 | #endif | ||
105 | 108 | ||
106 | #endif /* ARCH_HAS_SOCKET_TYPES */ | 109 | #endif /* ARCH_HAS_SOCKET_TYPES */ |
107 | 110 | ||
diff --git a/net/socket.c b/net/socket.c index a0ce8ad72252..d163adff95bf 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -69,6 +69,7 @@ | |||
69 | #include <linux/proc_fs.h> | 69 | #include <linux/proc_fs.h> |
70 | #include <linux/seq_file.h> | 70 | #include <linux/seq_file.h> |
71 | #include <linux/mutex.h> | 71 | #include <linux/mutex.h> |
72 | #include <linux/thread_info.h> | ||
72 | #include <linux/wanrouter.h> | 73 | #include <linux/wanrouter.h> |
73 | #include <linux/if_bridge.h> | 74 | #include <linux/if_bridge.h> |
74 | #include <linux/if_frad.h> | 75 | #include <linux/if_frad.h> |
@@ -1504,6 +1505,7 @@ out_fd: | |||
1504 | goto out_put; | 1505 | goto out_put; |
1505 | } | 1506 | } |
1506 | 1507 | ||
1508 | #ifdef HAVE_SET_RESTORE_SIGMASK | ||
1507 | asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | 1509 | asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, |
1508 | int __user *upeer_addrlen, | 1510 | int __user *upeer_addrlen, |
1509 | const sigset_t __user *sigmask, | 1511 | const sigset_t __user *sigmask, |
@@ -1541,6 +1543,21 @@ asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | |||
1541 | 1543 | ||
1542 | return ret; | 1544 | return ret; |
1543 | } | 1545 | } |
1546 | #else | ||
1547 | asmlinkage long sys_paccept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
1548 | int __user *upeer_addrlen, | ||
1549 | const sigset_t __user *sigmask, | ||
1550 | size_t sigsetsize, int flags) | ||
1551 | { | ||
1552 | /* The platform does not support restoring the signal mask in the | ||
1553 | * return path. So we do not allow using paccept() with a signal | ||
1554 | * mask. */ | ||
1555 | if (sigmask) | ||
1556 | return -EINVAL; | ||
1557 | |||
1558 | return do_accept(fd, upeer_sockaddr, upeer_addrlen, flags); | ||
1559 | } | ||
1560 | #endif | ||
1544 | 1561 | ||
1545 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, | 1562 | asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, |
1546 | int __user *upeer_addrlen) | 1563 | int __user *upeer_addrlen) |