diff options
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/highmem.h> | 17 | #include <linux/highmem.h> |
18 | #include <linux/pagemap.h> | 18 | #include <linux/pagemap.h> |
19 | #include <linux/audit.h> | 19 | #include <linux/audit.h> |
20 | #include <linux/syscalls.h> | ||
20 | 21 | ||
21 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
22 | #include <asm/ioctls.h> | 23 | #include <asm/ioctls.h> |
@@ -1076,6 +1077,26 @@ int do_pipe(int *fd) | |||
1076 | } | 1077 | } |
1077 | 1078 | ||
1078 | /* | 1079 | /* |
1080 | * sys_pipe() is the normal C calling standard for creating | ||
1081 | * a pipe. It's not the way Unix traditionally does this, though. | ||
1082 | */ | ||
1083 | asmlinkage long __weak sys_pipe(int __user *fildes) | ||
1084 | { | ||
1085 | int fd[2]; | ||
1086 | int error; | ||
1087 | |||
1088 | error = do_pipe(fd); | ||
1089 | if (!error) { | ||
1090 | if (copy_to_user(fildes, fd, sizeof(fd))) { | ||
1091 | sys_close(fd[0]); | ||
1092 | sys_close(fd[1]); | ||
1093 | error = -EFAULT; | ||
1094 | } | ||
1095 | } | ||
1096 | return error; | ||
1097 | } | ||
1098 | |||
1099 | /* | ||
1079 | * pipefs should _never_ be mounted by userland - too much of security hassle, | 1100 | * pipefs should _never_ be mounted by userland - too much of security hassle, |
1080 | * no real gain from having the whole whorehouse mounted. So we don't need | 1101 | * no real gain from having the whole whorehouse mounted. So we don't need |
1081 | * any operations on the root directory. However, we need a non-trivial | 1102 | * any operations on the root directory. However, we need a non-trivial |