Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: zselect builtin.



Borsenkow Andrej wrote:
> If we start adding low-level system interface I really wish that we
> 
> - put it in separate module (like Perl POSIX)
> - or at least under own hierarchy (like zsh/POSIX/select)
> 
> In which case it would be nice (as Bart already suggested) to have
> standard name pattern; posix_select or sys_select (depending upon level
> of system independency we are aiming at).

It's too late: we have stat, the files module, and various other bits
which talk to the system in other ways like TCP.  Unless we want to move
everything around now, I don't see a good reason for putting this
anywhere special.  (`stat' already clashes with various external
commands which do a similar job, unfortunately.)  Until then, separate
modules for each separate interface seems to me the cleanest way
forward.

Why is `posix_select' or `sys_select' an improvement over our current
mini-convention with the `z', which also covers things which aren't
strictly tied to system calls?  To me, anyway, it implies a greater
tie-in to the underlying system call than you get with the shell builtin
--- no fd sets, no maximum fd, no errno handling.  This is a distinct
difference from perl, which tries to emulate the POSIX interface as
closely as possible in such cases.

(By the way, there was an interesting note on the Austin group list today
that the `error' fd's in the select call are really for exceptions, and
the only one currently defined is out-of-band data on a socket.  I may
point this out, since most select manual pages don't.)

> Aso you probably can't fully utilize select without non-blocking I/O.

I don't see this; you can already poll a blocking fd using a zero
timeout.  But some fcntl interface is certainly a possibility.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author