Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does EAGAIN mean?

As in the title what does EAGAIN mean?

like image 714
David van Dugteren Avatar asked Oct 30 '10 10:10

David van Dugteren


People also ask

What is Ewouldblock?

EWOULDBLOCK means that the socket send buffer is full when sending, or that the socket receive buffer is empty when receiving. You are supposed to use select() to detect when these conditions become false.

Is errno set on success?

errno The value in errno is significant only when the return value of the call indicated an error (i.e., -1 from most system calls; -1 or NULL from most library functions); a function that succeeds is allowed to change errno. The value of errno is never set to zero by any system call or library function.


2 Answers

EAGAIN is often raised when performing non-blocking I/O. It means "there is no data available right now, try again later".

It might (or might not) be the same as EWOULDBLOCK, which means "your thread would have to block in order to do that".

like image 73
Frédéric Hamidi Avatar answered Oct 04 '22 23:10

Frédéric Hamidi


Using man 2 intro | less -Ip EAGAIN:

     35 EAGAIN Resource temporarily unavailable.  This is a temporary condi-          tion and later calls to the same routine may complete normally. 
like image 21
turfx Avatar answered Oct 05 '22 00:10

turfx