This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Intended semantics for syscalls function _read?


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

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]