[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: run.c translator

From: Roland McGrath
Subject: Re: run.c translator
Date: Tue, 19 Mar 2002 21:31:05 -0500 (EST)

Rather than just ignoring the offset, you should check for -1 and return
ESPIPE otherwise, so pread/pwrite fail as they should.

I'd say you should use getdport at the beginning and use io_read and the
like directly instead of read.  That is more efficient and also shows what
the client calls look like.  But if you are deliberately using the POSIX
calls to make the example more clear, then you should change io_readable to
ioctl(,FIONREAD) and have it be complete.

You're using fork2 just to avoid zombies, right?  I would say that you
should instead do a simple reaping loop with WNOHANG at convenient times
like when you read EOF on a pipe.  That also gives you the opportunity to
print an error if you have a stderr and the spawned program exits abnormally.

I don't like the name /hurd/run so much.  Maybe /hurd/pipeto?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]