Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ aio_write(3) — IRIX 6.5.3f

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

aio_read(3)

lio_listio(3)

aio_error(3)

aio_return(3)

aio_hold(3)

aio_cancel(3)

aio_sgi_init(3)

aio_fsync(3)

write(2)

lseek(2)

close(2)

_exit(2)

exec(2)

fork(2)

pthreads(5)

sysconf(3C)



AIOWRITE(3)                                                      AIOWRITE(3)



NAME
     aio_write, aio_write64 - asynchronous I/O write

C SYNOPSIS
     #include <aio.h>

     int aiowrite(aiocbt *aiocbp);

     int aiowrite64(aiocb64t *aiocbp);

DESCRIPTION
     The aiowrite() function allows the calling process to write aiocbp-
     >aionbytes from the file associated with aiocbp->aiofildes into the
     buffer pointed to by aiocbp->aiobuf (see write(2)).  The function call
     returns when the write request has been initiated or, at a minimum,
     queued for the file or device.

     The aiocb->aiosigevent defines how the calling process will be notified
     upon I/O completion.

     If sigevnotify is SIGEVNONE, then no notification will be posted to the
     calling application.

     If sigevnotify is SIGEVSIGNAL, then the signal specified in sigevsigno
     will be sent to the calling process. If SASIGINFO is set for the signal
     (see sigaction(2)) and the signal is in the range of SIGRTMIN and
     SIGRTMAX then the signal will be queued to the process and the value in
     sigevvalue will be the sivalue in the generated signal.

     If sigevnotify is SIGEVCALLBACK then the function sigevfunc will be
     called with sigevvalue as the argument. Only one callback will be called
     at a time, however programs should be careful to note that a callback may
     be run in parallel with the calling process.

     If sigevnotify is SIGEVTHREAD then the function sigevnotifyfunction
     will be called by a new thread (see pthreads(5)) with sigevvalue as the
     argument.  This thread is created when the event arrives with the
     attributes specified in sigevnotifyattributes except that it is
     automatically detached.  The calling process should ensure there are
     sufficient resources to create the thread.

     All aiowrite() calls must supply a complete aiocb->aiosigevent
     structure.

     The aiocbp->aiolioopcode field is ignored by aiowrite().

     Prioritized I/O is not currently supported among asynchronous file
     operations.  aiocbp->aioreqprio must be set to 0, otherwise the call
     will fail.






                                                                        Page 1





AIOWRITE(3)                                                      AIOWRITE(3)



     The I/O requests submitted in an unspecified order unless the file was
     opened with the OAPPEND in which case the write operations will happen
     in the order that they were submitted.

     After a call to aiowrite the aiocbp may be used as an argument to
     aioerror() and aioreturn() in order to determine the error status and
     return status, respectively, of the asynchronous operation while it is
     proceeding. If an error condition is encountered during queueing, the
     function call returns without having initiated or queued the request.
     After a successful call to enqueue an asynchronous I/O operation, the
     value of the file offset for the file is undefined.

     If the buffer pointed to by aiocbp->aiobuf or the control block pointed
     to by aiocbp changes or becomes an illegal address prior to asynchronous
     I/O completion then the behavior is undefined.  Simultaneous asynchronous
     operations using the same aiocbp produce undefined results.

     For any system action that changes the process memory space while an
     asynchronous I/O is outstanding to the address range being changed, the
     result of that asynchronous I/O is undefined.

     The aiowrite64() function is identical to aiowrite() except that it
     takes an aiocb64t * (see <aio.h>).  This structure allows for the
     specification of a file offset greater than 2 Gigabytes.


SEE ALSO
     aio_read(3), lio_listio(3), aio_error(3), aio_return(3), aio_hold(3),
     aio_cancel(3), aio_sgi_init(3), aio_fsync(3), write(2), lseek(2),
     close(2), _exit(2), exec(2), fork(2), pthreads(5), sysconf(3C).

DIAGNOSTICS
     The aiowrite() returns the value 0 to the calling process if the I/O
     operation is successfully queued; otherwise, the function shall return
     the value -1 and shall set errno to indicate the error.

     [EAGAIN]       The requested asynchronous I/O operation was not queued
                    due to system resource limitations. Often this is due to
                    exceeding the maximum number of asynchronous I/O
                    operations for the system. The maximum can be checked with
                    a call to sysconf() with an argument of SCAIOMAX.

     Each of the following conditions may be detected synchronously at the
     time of the call to aiowrite() , or asynchronously. If any of the
     conditions below are detected synchronously at the time of the call, the
     aiowrite() function shall return -1 and set errno to the corresponding
     value. If any of the conditions below are detected asynchronously, the
     return status of the asynchronous operation shall be set to -1 and the
     error status of the asynchronous operation shall be set to the
     corresponding value.





                                                                        Page 2





AIOWRITE(3)                                                      AIOWRITE(3)



     [EBADF]        The aiocbp->aiofildes argument is not a valid file
                    descriptor open for writing.

     [EINVAL]       The file offset value implied by aiocbp->aiooffset would
                    be invalid, aiocbp->aioreqprio is not a valid value, or
                    aiocbp->aionbytes is an invalid value.

     In the case that the aiowrite() successfully queues the I/O operation,
     the return status of the asynchronous operation shall be one of the
     values normally returned by the write(2) function call. If the operation
     is successfully queued, but is subsequently canceled or encounters an
     error, the error status for the asynchronous operation shall contain one
     of the values normally set by the write(2) function call, or one of the
     following:

     [EBADF]        The aiocbp->aiofildes argument is not a valid file
                    descriptor open for writing.

     [EINVAL]       The file offset value implied by aiocbp->aiooffset would
                    be invalid.

     [ECANCELED]    The requested I/O was canceled before the I/O completed
                    due to an explicit aiocancel(3) request.
































                                                                        Page 3



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