Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ aio_suspend(3P4) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

aio_read(3P4)

aio_write(3P4)

aio_fsync(3P4)

aio_error(3P4)

aio_return(3P4)

aio_cancel(3P4)

lio_listio(3P4)

aio_suspend(3P4)

NAME

aio_suspend − wait for asynchronous I/O completion

SYNOPSIS

#include <aio.h> int aio_suspend(aiocbp, count, timeout)

struct aiocb ∗∗aiocbp;

int count;

struct timespec ∗timeout;

DESCRIPTION

The aio_suspend() function suspends the calling process until at least one of the asynchronous I/O operations referenced by the aiocbp argument has completed, until a signal interrupts the function, or until the time interval specified by timeout has passed.  timeout can be specified as NULL if no timeout is desired. 

If any of the aiocb structures in the list correspond to completed asynchronous I/O operations (i.e., the error status for the operation is not equal to [EINPROGRESS]) at the time of the call, the function returns without suspending the calling process. 

The aiocbp argument points to an array of pointers to asynchronous I/O control blocks. The count argument indicates the number of elements in the array. Each aiocb structure pointed to shall have been used in initiating an asynchronous I/O request via aio_read(3P4), aio_write(3P4), or lio_listio(3P4).  This array may contain NULL pointers, which are ignored. 

If the time interval indicated in the timeval structure pointed to by timeout passes before any of the I/O operations referenced by aiocbp are completed, then aio_suspend() will return with an error. 

RETURN VALUE

If aio_suspend() returns after one or more asynchronous I/O operations have completed, zero is returned. 

The application may determine which asynchronous I/O operation completed by scanning the associated error status using aio_error(3P4). 

If any of the following conditions occur, aio_suspend() returns a -1 and sets errno to the corresponding value. 

[EAGAIN] No asynchronous I/O indicated in the list referenced by aiocbp completed in the time interval indicated by timeout.  The requested asynchronous operation could not be done due to temporary resource limitations. There is not enough kernel memory available to copy the table of pointers to aiocb structures into kernel space. 

[EINTR] A signal interrupted the aio_suspend() function.  Note that since each asynchronous I/O operation may possibly provoke a signal when it completes, this error return may be caused by the completion of one (or more) of the very I/O operations being awaited. 

[EINVAL] The structure pointed to by the timeout parameter has zero values. If the caller doesn’t want to specify a time interval, then the timeout parameter, itself, should be a NULL pointer. 

[EFAULT] The system is unable to access the aiocb structure that the aiocbp argument points to. 

FILES

/usr/lib/libposix4.a

SEE ALSO

aio_read(3P4), aio_write(3P4), aio_fsync(3P4), aio_error(3P4), aio_return(3P4), aio_cancel(3P4), lio_listio(3P4), "CX/UX Programmer’s Guide"
 

WARNING

The interface to aio_suspend() is based on IEEE Draft Standard P1003.4/D12.  This is an unapproved draft, subject to change.  Use of information contained in this unapproved draft is at your own risk.  This interface will change to reflect any changes made by future drafts of POSIX 1003.4. 
 

CX/UX Programmer’s Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026