#include <sys/pipe.h>

sys/pipe.h

NOTICE: This file was modified by SPARTA, Inc. in 2006 to introduce support for mandatory and extensible security protections. This notice is included in support of clause 2.2 (b) of the Apple Public License, Version 2.0.
18 macros · 1 struct

macroPIPE_SIZE

Pipe buffer size, keep moderate in value, pipes take kva space.
#define PIPE_SIZE 16384

macroPIPE_KVAMAX

#define PIPE_KVAMAX (1024 * 1024 * 16)

macroBIG_PIPE_SIZE

#define BIG_PIPE_SIZE (64*1024)

macroSMALL_PIPE_SIZE

#define SMALL_PIPE_SIZE PAGE_SIZE

macroPIPE_MINDIRECT

PIPE_MINDIRECT MUST be smaller than PIPE_SIZE and MUST be bigger than PIPE_BUF.
#define PIPE_MINDIRECT 8192

macroPIPENPAGES

#define PIPENPAGES (BIG_PIPE_SIZE / PAGE_SIZE + 1)

structpipebuf

Pipe buffer information. Separate in, out, cnt are used to simplify calculations. Buffered write is active when the buffer.cnt field is set.
size 24, align 8
u_intcntnumber of chars currently in buffer
u_intinin pointer
u_intoutout pointer
u_intsizesize of buffer
caddr_tbufferkva of buffer

macroPIPE_ASYNC

Bits in pipe_state.
#define PIPE_ASYNC 0x004
Async? I/O.

macroPIPE_WANTR

#define PIPE_WANTR 0x008
Reader wants some characters.

macroPIPE_WANTW

#define PIPE_WANTW 0x010
Writer wants space to put characters.

macroPIPE_WANT

#define PIPE_WANT 0x020
Pipe is wanted to be run-down.

macroPIPE_EOF

was PIPE_SEL 0x040 /* Pipe has a select active. */
#define PIPE_EOF 0x080
Pipe is in EOF condition.

macroPIPE_LOCKFL

#define PIPE_LOCKFL 0x100
Process has exclusive access to pointers/data.

macroPIPE_LWANT

#define PIPE_LWANT 0x200
Process wants exclusive access to pointers/data.

macroPIPE_DIRECTW

#define PIPE_DIRECTW 0x400
Pipe direct write active.

macroPIPE_DIRECTOK

#define PIPE_DIRECTOK 0x800
Direct mode ok.

macroPIPE_DRAIN

was PIPE_KNOTE 0x1000
#define PIPE_DRAIN 0x2000
Waiting for I/O to drop for a close. Treated like EOF; only separate for easier debugging.

macroPIPE_WSELECT

#define PIPE_WSELECT 0x4000
Some thread has done an FWRITE select on the pipe

macroPIPE_DEAD

#define PIPE_DEAD 0x8000
Pipe is dead and needs garbage collection