diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-16 21:27:38 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-16 21:27:38 +0000 |
commit | 076114decb8bc3f4b8fd742e9b50fac5aafc9425 (patch) | |
tree | 970bedebb0dafe67321cd4aa6ebbe8bd91b5abb1 | |
parent | 73217ea06ff1f15439b31e83098915ae484d1db7 (diff) |
Move defining of PIPE_NODIRECT to pipe.h and conditionalize more code with it.
This allows this code to compile on sparc.
-rw-r--r-- | sys/kern/sys_pipe.c | 13 | ||||
-rw-r--r-- | sys/sys/pipe.h | 17 |
2 files changed, 19 insertions, 11 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 559ceee1c09..990fd6b79e4 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.8 1997/11/06 05:58:21 csapuntz Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.9 1999/02/16 21:27:37 art Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -88,15 +88,6 @@ #include <sys/pipe.h> /* - * Use this define if you want to disable *fancy* VM things. Expect an - * approx 30% decrease in transfer rate. This could be useful for - * NetBSD or OpenBSD. - */ -#if defined(__NetBSD__) || defined(__OpenBSD__) -#define PIPE_NODIRECT -#endif - -/* * interfaces to the outside world */ int pipe_read __P((struct file *, struct uio *, struct ucred *)); @@ -981,9 +972,11 @@ pipe_ioctl(fp, cmd, data, p) return (0); case FIONREAD: +#ifndef PIPE_NODIRECT if (mpipe->pipe_state & PIPE_DIRECTW) *(int *)data = mpipe->pipe_map.cnt; else +#endif *(int *)data = mpipe->pipe_buffer.cnt; return (0); diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h index 530c16da263..e3b045f55aa 100644 --- a/sys/sys/pipe.h +++ b/sys/sys/pipe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pipe.h,v 1.2 1996/09/04 22:38:47 niklas Exp $ */ +/* $OpenBSD: pipe.h,v 1.3 1999/02/16 21:27:37 art Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -34,6 +34,17 @@ #endif /* _KERNEL */ /* + * Use this define if you want to disable *fancy* VM things. Expect an + * approx 30% decrease in transfer rate. This could be useful for + * NetBSD or OpenBSD. + */ +#ifdef _KERNEL +#if defined(__NetBSD__) || defined(__OpenBSD__) +#define PIPE_NODIRECT +#endif +#endif + +/* * Pipe buffer size, keep moderate in value, pipes take kva space. */ #ifndef PIPE_SIZE @@ -72,6 +83,7 @@ struct pipebuf { struct vm_object *object; /* VM object containing buffer */ }; +#ifndef PIPE_NODIRECT /* * Information to support direct transfers between processes for pipes. */ @@ -82,6 +94,7 @@ struct pipemapping { int npages; /* number of pages */ vm_page_t ms[PIPENPAGES]; /* pages in source process */ }; +#endif /* * Bits in pipe_state. @@ -103,7 +116,9 @@ struct pipemapping { */ struct pipe { struct pipebuf pipe_buffer; /* data storage */ +#ifndef PIPE_NODIRECT struct pipemapping pipe_map; /* pipe mapping for direct I/O */ +#endif struct selinfo pipe_sel; /* for compat with select */ struct timeval pipe_atime; /* time of last access */ struct timeval pipe_mtime; /* time of last modify */ |