Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/sys_pipe.c
Show First 20 Lines • Show All 877 Lines • ▼ Show 20 Lines | unlocked_error: | ||||
* Otherwise, when calling read(2) at EOF, a spurious wakeup occurs. | * Otherwise, when calling read(2) at EOF, a spurious wakeup occurs. | ||||
*/ | */ | ||||
if (nread > 0 && | if (nread > 0 && | ||||
rpipe->pipe_buffer.size - rpipe->pipe_buffer.cnt >= PIPE_BUF) | rpipe->pipe_buffer.size - rpipe->pipe_buffer.cnt >= PIPE_BUF) | ||||
pipeselwakeup(rpipe); | pipeselwakeup(rpipe); | ||||
PIPE_UNLOCK(rpipe); | PIPE_UNLOCK(rpipe); | ||||
if (nread > 0) | if (nread > 0) | ||||
td->td_ru.ru_msgrcv++; | RU_ATOMIC_INC(td->td_ru.ru_msgrcv); | ||||
return (error); | return (error); | ||||
} | } | ||||
#ifndef PIPE_NODIRECT | #ifndef PIPE_NODIRECT | ||||
/* | /* | ||||
* Map the sending processes' buffer into kernel space and wire it. | * Map the sending processes' buffer into kernel space and wire it. | ||||
* This is similar to a physical write operation. | * This is similar to a physical write operation. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 442 Lines • ▼ Show 20 Lines | #endif | ||||
* wake up select/poll. | * wake up select/poll. | ||||
*/ | */ | ||||
if (wpipe->pipe_buffer.cnt) | if (wpipe->pipe_buffer.cnt) | ||||
pipeselwakeup(wpipe); | pipeselwakeup(wpipe); | ||||
pipeunlock(wpipe); | pipeunlock(wpipe); | ||||
PIPE_UNLOCK(rpipe); | PIPE_UNLOCK(rpipe); | ||||
if (uio->uio_resid != orig_resid) | if (uio->uio_resid != orig_resid) | ||||
td->td_ru.ru_msgsnd++; | RU_ATOMIC_INC(td->td_ru.ru_msgsnd); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* ARGSUSED */ | /* ARGSUSED */ | ||||
static int | static int | ||||
pipe_truncate(struct file *fp, off_t length, struct ucred *active_cred, | pipe_truncate(struct file *fp, off_t length, struct ucred *active_cred, | ||||
struct thread *td) | struct thread *td) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 491 Lines • Show Last 20 Lines |