diff options
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c index e3c21d5ec288..e2d5bae994de 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -107,6 +107,10 @@ static unsigned int sock_poll(struct file *file, | |||
107 | struct poll_table_struct *wait); | 107 | struct poll_table_struct *wait); |
108 | static long sock_ioctl(struct file *file, | 108 | static long sock_ioctl(struct file *file, |
109 | unsigned int cmd, unsigned long arg); | 109 | unsigned int cmd, unsigned long arg); |
110 | #ifdef CONFIG_COMPAT | ||
111 | static long compat_sock_ioctl(struct file *file, | ||
112 | unsigned int cmd, unsigned long arg); | ||
113 | #endif | ||
110 | static int sock_fasync(int fd, struct file *filp, int on); | 114 | static int sock_fasync(int fd, struct file *filp, int on); |
111 | static ssize_t sock_readv(struct file *file, const struct iovec *vector, | 115 | static ssize_t sock_readv(struct file *file, const struct iovec *vector, |
112 | unsigned long count, loff_t *ppos); | 116 | unsigned long count, loff_t *ppos); |
@@ -128,6 +132,9 @@ static struct file_operations socket_file_ops = { | |||
128 | .aio_write = sock_aio_write, | 132 | .aio_write = sock_aio_write, |
129 | .poll = sock_poll, | 133 | .poll = sock_poll, |
130 | .unlocked_ioctl = sock_ioctl, | 134 | .unlocked_ioctl = sock_ioctl, |
135 | #ifdef CONFIG_COMPAT | ||
136 | .compat_ioctl = compat_sock_ioctl, | ||
137 | #endif | ||
131 | .mmap = sock_mmap, | 138 | .mmap = sock_mmap, |
132 | .open = sock_no_open, /* special open code to disallow open via /proc */ | 139 | .open = sock_no_open, /* special open code to disallow open via /proc */ |
133 | .release = sock_close, | 140 | .release = sock_close, |
@@ -2136,6 +2143,20 @@ void socket_seq_show(struct seq_file *seq) | |||
2136 | } | 2143 | } |
2137 | #endif /* CONFIG_PROC_FS */ | 2144 | #endif /* CONFIG_PROC_FS */ |
2138 | 2145 | ||
2146 | #ifdef CONFIG_COMPAT | ||
2147 | static long compat_sock_ioctl(struct file *file, unsigned cmd, | ||
2148 | unsigned long arg) | ||
2149 | { | ||
2150 | struct socket *sock = file->private_data; | ||
2151 | int ret = -ENOIOCTLCMD; | ||
2152 | |||
2153 | if (sock->ops->compat_ioctl) | ||
2154 | ret = sock->ops->compat_ioctl(sock, cmd, arg); | ||
2155 | |||
2156 | return ret; | ||
2157 | } | ||
2158 | #endif | ||
2159 | |||
2139 | /* ABI emulation layers need these two */ | 2160 | /* ABI emulation layers need these two */ |
2140 | EXPORT_SYMBOL(move_addr_to_kernel); | 2161 | EXPORT_SYMBOL(move_addr_to_kernel); |
2141 | EXPORT_SYMBOL(move_addr_to_user); | 2162 | EXPORT_SYMBOL(move_addr_to_user); |