summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commit5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/kern/sys_pipe.c
parent83e00d4274950d2b531c24692cd123538ffbddb9 (diff)
downloadFreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip
FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r--sys/kern/sys_pipe.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index dcc57d8..b543ddf 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -90,15 +90,15 @@
* interfaces to the outside world
*/
static int pipe_read __P((struct file *fp, struct uio *uio,
- struct ucred *cred, int flags, struct proc *p));
+ struct ucred *cred, int flags, struct thread *td));
static int pipe_write __P((struct file *fp, struct uio *uio,
- struct ucred *cred, int flags, struct proc *p));
-static int pipe_close __P((struct file *fp, struct proc *p));
+ struct ucred *cred, int flags, struct thread *td));
+static int pipe_close __P((struct file *fp, struct thread *td));
static int pipe_poll __P((struct file *fp, int events, struct ucred *cred,
- struct proc *p));
+ struct thread *td));
static int pipe_kqfilter __P((struct file *fp, struct knote *kn));
-static int pipe_stat __P((struct file *fp, struct stat *sb, struct proc *p));
-static int pipe_ioctl __P((struct file *fp, u_long cmd, caddr_t data, struct proc *p));
+static int pipe_stat __P((struct file *fp, struct stat *sb, struct thread *td));
+static int pipe_ioctl __P((struct file *fp, u_long cmd, caddr_t data, struct thread *td));
static struct fileops pipeops = {
pipe_read, pipe_write, pipe_ioctl, pipe_poll, pipe_kqfilter,
@@ -166,13 +166,13 @@ static vm_zone_t pipe_zone;
/* ARGSUSED */
int
-pipe(p, uap)
- struct proc *p;
+pipe(td, uap)
+ struct thread *td;
struct pipe_args /* {
int dummy;
} */ *uap;
{
- struct filedesc *fdp = p->p_fd;
+ struct filedesc *fdp = td->td_proc->p_fd;
struct file *rf, *wf;
struct pipe *rpipe, *wpipe;
int fd, error;
@@ -190,14 +190,14 @@ pipe(p, uap)
rpipe->pipe_state |= PIPE_DIRECTOK;
wpipe->pipe_state |= PIPE_DIRECTOK;
- error = falloc(p, &rf, &fd);
+ error = falloc(td, &rf, &fd);
if (error) {
pipeclose(rpipe);
pipeclose(wpipe);
return (error);
}
fhold(rf);
- p->p_retval[0] = fd;
+ td->td_retval[0] = fd;
/*
* Warning: once we've gotten past allocation of the fd for the
@@ -209,13 +209,13 @@ pipe(p, uap)
rf->f_type = DTYPE_PIPE;
rf->f_data = (caddr_t)rpipe;
rf->f_ops = &pipeops;
- error = falloc(p, &wf, &fd);
+ error = falloc(td, &wf, &fd);
if (error) {
- if (fdp->fd_ofiles[p->p_retval[0]] == rf) {
- fdp->fd_ofiles[p->p_retval[0]] = NULL;
- fdrop(rf, p);
+ if (fdp->fd_ofiles[td->td_retval[0]] == rf) {
+ fdp->fd_ofiles[td->td_retval[0]] = NULL;
+ fdrop(rf, td);
}
- fdrop(rf, p);
+ fdrop(rf, td);
/* rpipe has been closed by fdrop(). */
pipeclose(wpipe);
return (error);
@@ -224,11 +224,11 @@ pipe(p, uap)
wf->f_type = DTYPE_PIPE;
wf->f_data = (caddr_t)wpipe;
wf->f_ops = &pipeops;
- p->p_retval[1] = fd;
+ td->td_retval[1] = fd;
rpipe->pipe_peer = wpipe;
wpipe->pipe_peer = rpipe;
- fdrop(rf, p);
+ fdrop(rf, td);
return (0);
}
@@ -390,11 +390,11 @@ pipeselwakeup(cpipe)
/* ARGSUSED */
static int
-pipe_read(fp, uio, cred, flags, p)
+pipe_read(fp, uio, cred, flags, td)
struct file *fp;
struct uio *uio;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
int flags;
{
struct pipe *rpipe = (struct pipe *) fp->f_data;
@@ -755,11 +755,11 @@ error1:
#endif
static int
-pipe_write(fp, uio, cred, flags, p)
+pipe_write(fp, uio, cred, flags, td)
struct file *fp;
struct uio *uio;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
int flags;
{
int error = 0;
@@ -1029,11 +1029,11 @@ pipe_write(fp, uio, cred, flags, p)
* we implement a very minimal set of ioctls for compatibility with sockets.
*/
int
-pipe_ioctl(fp, cmd, data, p)
+pipe_ioctl(fp, cmd, data, td)
struct file *fp;
u_long cmd;
caddr_t data;
- struct proc *p;
+ struct thread *td;
{
struct pipe *mpipe = (struct pipe *)fp->f_data;
@@ -1078,11 +1078,11 @@ pipe_ioctl(fp, cmd, data, p)
}
int
-pipe_poll(fp, events, cred, p)
+pipe_poll(fp, events, cred, td)
struct file *fp;
int events;
struct ucred *cred;
- struct proc *p;
+ struct thread *td;
{
struct pipe *rpipe = (struct pipe *)fp->f_data;
struct pipe *wpipe;
@@ -1108,12 +1108,12 @@ pipe_poll(fp, events, cred, p)
if (revents == 0) {
if (events & (POLLIN | POLLRDNORM)) {
- selrecord(p, &rpipe->pipe_sel);
+ selrecord(curthread, &rpipe->pipe_sel);
rpipe->pipe_state |= PIPE_SEL;
}
if (events & (POLLOUT | POLLWRNORM)) {
- selrecord(p, &wpipe->pipe_sel);
+ selrecord(curthread, &wpipe->pipe_sel);
wpipe->pipe_state |= PIPE_SEL;
}
}
@@ -1122,10 +1122,10 @@ pipe_poll(fp, events, cred, p)
}
static int
-pipe_stat(fp, ub, p)
+pipe_stat(fp, ub, td)
struct file *fp;
struct stat *ub;
- struct proc *p;
+ struct thread *td;
{
struct pipe *pipe = (struct pipe *)fp->f_data;
@@ -1148,9 +1148,9 @@ pipe_stat(fp, ub, p)
/* ARGSUSED */
static int
-pipe_close(fp, p)
+pipe_close(fp, td)
struct file *fp;
- struct proc *p;
+ struct thread *td;
{
struct pipe *cpipe = (struct pipe *)fp->f_data;
OpenPOWER on IntegriCloud