Use syspipe, not the old kfs, for pipes
authorRonald G. Minnich <rminnich@google.com>
Tue, 21 Jan 2014 18:34:06 +0000 (10:34 -0800)
committerRonald G. Minnich <rminnich@google.com>
Tue, 21 Jan 2014 18:34:06 +0000 (10:34 -0800)
note that the pipes are bidi.

note also that I broke pipe but I think Barret will fix as always.

Signed-off-by: Ronald G. Minnich <rminnich@google.com>
kern/src/syscall.c

index 9686691..0ae92d9 100644 (file)
@@ -1443,11 +1443,11 @@ intreg_t sys_rmdir(struct proc *p, const char *path, size_t path_l)
 intreg_t sys_pipe(struct proc *p, int *u_pipefd, int flags)
 {
        int pipefd[2] = {0};
 intreg_t sys_pipe(struct proc *p, int *u_pipefd, int flags)
 {
        int pipefd[2] = {0};
+       int retval = syspipe(pipefd);
        int fd;
        int fd;
-       int retval = 0;
        struct file *pipe_files[2] = {0};
 
        struct file *pipe_files[2] = {0};
 
-       if (do_pipe(pipe_files, flags))
+       if (retval)
                return -1;
        fd = insert_file(&p->open_files, pipe_files[0], 0);
        if (!fd) {
                return -1;
        fd = insert_file(&p->open_files, pipe_files[0], 0);
        if (!fd) {