Intended semantics for syscalls function _read?

Eric Blake eblake@redhat.com
Mon Nov 21 15:06:00 GMT 2016


On 11/21/2016 07:16 AM, s.achterop@rug.nl wrote:
>    Hello list,
> 
> The documentation of this function does not describe how this function is to behave.
> Is it blocking, or can it also be non-blocking.
> What is the meaning of the return value? Or is it intentionally left ambiguous?

Your _read() function is supposed to behave similarly to the
POSIX-defined read(2) function:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html

> Can I use (man 2) read in a non-blocking way? Or is there an other way?

If you've properly implemented fcntl(2), then you can set O_NONBLOCK to
get non-blocking reads.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/newlib/attachments/20161121/db590f39/attachment.sig>


More information about the Newlib mailing list