This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Aio: 'Resource Temporarily unavailable'
- From: Amos Waterland <apw at us dot ibm dot com>
- To: Bourne <bourne at ToughGuy dot net>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Thu, 9 Jan 2003 11:00:05 -0600
- Subject: Re: Aio: 'Resource Temporarily unavailable'
- References: <3E1D69F9.3010502@ToughGuy.net>
On Thu, Jan 09, 2003 at 05:54:25PM +0530, Bourne wrote:
> browsing the aio_suspend code, i have found out that if a timeout is
> specified to aio_suspend, and if the operation does not finish within
> the specified time, then ETIMEDOUT is returned which is returned as a
> 'Resource Temporarily unavailable' error to the user program.
>
> My question is, if such an error is encountered then is it a valid
> error( i.e, is it a common occurance ? ) OR is it something which should
> never happen but has happened and something in glibc needs to be fixed ?
>From the SuSv3[1]:
The aio_suspend() function shall fail if:
[EAGAIN] No asynchronous I/O indicated in the list referenced by list
completed in the time interval indicated by timeout.
Glibc's implementation is correct. ETIMEDOUT is not being returned, but
rather -1 is being returned with errno[2] set to EAGAIN (aio_suspend.c,
line 157), as per the standard.
As for a "common occurrence": it will occur any time the worker thread
cannot complete any of the requested I/O operations before the specified
timeout, by definition. This can happen for a variety of reasons, one
of which is that the system is under heavy I/O load.
Amos Waterland
[1] http://www.opengroup.org/onlinepubs/007904975/functions/aio_suspend.html
[2]
% cat test0042.c
#include <stdio.h>
#include <errno.h>
#include <string.h>
int main( int argc, char **argv )
{
printf ("EAGAIN: %s\n", strerror (EAGAIN));
printf ("ETIMEDOUT: %s\n", strerror (ETIMEDOUT));
return 0;
}
% ./test0042
EAGAIN: Resource temporarily unavailable
ETIMEDOUT: Connection timed out