aio_write(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

aio_write(3c)

Standard C Library Functions                                     aio_write(3C)



NAME
       aio_write - asynchronous write to a file

SYNOPSIS
       #include <aio.h>

       int aio_write(struct aiocb *aiocbp);

DESCRIPTION
       The   aio_write()   function   allows  the  calling  process  to  write
       aiocbp→aio_nbytes to the file associated  with  aiocbp→aio_fildes  from
       the buffer pointed to by aiocbp→aio_buf. The function call returns when
       the write request has been initiated or, at a minimum,  queued  to  the
       file or device. If _POSIX_PRIORITIZED_IO is defined and prioritized I/O
       is supported for this file, then the asynchronous operation is  submit‐
       ted at a priority equal to the scheduling priority of the process minus
       aiocbp→aio_reqprio.  The  aiocbp  may  be  used  as  an   argument   to
       aio_error(3C) and aio_return(3C) in order to determine the error status
       and return status, respectively, of the asynchronous operation while it
       is proceeding.


       The aiocbp argument points to an aiocb structure. If the buffer pointed
       to by aiocbp→aio_buf or the control block pointed to by aiocbp  becomes
       an  illegal  address  prior  to  asynchronous  I/O completion, then the
       behavior is undefined.


       If O_APPEND is not set for the file  descriptor  aio_fildes,  then  the
       requested operation takes place at the absolute position in the file as
       given by aio_offset, as if lseek(2) were called  immediately  prior  to
       the  operation with an offset equal to aio_offset and a whence equal to
       SEEK_SET. If O_APPEND is set for the file descriptor, write  operations
       append  to  the  file in the same order as the calls were made. After a
       successful call to enqueue an asynchronous I/O operation, the value  of
       the file offset for the file is unspecified.


       The  aiocbp→aio_sigevent  structure defines what asynchronous notifica‐
       tion is to occur when the asynchronous operation completes,  as  speci‐
       fied in signal.h(3HEAD).


       If  SIGEV_MEM  sigevent  type is specified, the error and return values
       are updated in the aiocb_t structure when I/O  is  completed.  Applica‐
       tions  can get the error value using aio_error(3C) and the return value
       using   aio_return(3C).   For   SIGEV_MEM   sigevent   type   requests,
       aio_error(3C)  and  aio_return(3C)  simply  return the error and return
       values from the structure, no system calls are involved. While the  I/O
       is  in progress an EINPROGRESS error is returned. I/O completion can be
       detected by monitoring the error value returned by aio_error(3C).


       The aiocbp→aio_lio_opcode field is ignored by aio_write().


       Simultaneous asynchronous operations  using  the  same  aiocbp  produce
       undefined results.


       If _POSIX_SYNCHRONIZED_IO is defined and synchronized I/O is enabled on
       the file associated with aiocbp→aio_fildes, the behavior of this  func‐
       tion  shall  be  according  to the definitions of synchronized I/O data
       integrity completion and synchronized I/O file integrity completion.


       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 action is undefined.


       For regular files, no data transfer will occur past the offset  maximum
       established    in   the   open   file   description   associated   with
       aiocbp→aio_fildes.

RETURN VALUES
       The aio_write() function returns 0 to the calling process  if  the  I/O
       operation  is  successfully  queued; otherwise, the function returns −1
       and sets errno to indicate the error.

ERRORS
       The aio_write() function will fail if:

       EAGAIN    The requested asynchronous I/O operation was not  queued  due
                 to system resource limitations.



       Each  of  the following conditions may be detected synchronously at the
       time of the call to aio_write(), or asynchronously. If any of the  con‐
       ditions  below  are  detected  synchronously,  the aio_write() function
       returns −1 and sets errno to the corresponding value.  If  any  of  the
       conditions  below are detected asynchronously, the return status of the
       asynchronous operation is set to −1, and the error status of the  asyn‐
       chronous operation will be set to the corresponding value.

       EBADF     The aiocbp→aio_fildes argument is not a valid file descriptor
                 open for writing.


       EINVAL    The file offset value implied by aiocbp->aio_offset would  be
                 invalid,   aiocbp->aio_reqprio  is  not  a  valid  value,  or
                 aiocbp→aio_nbytes is an invalid value.



       In the case that the aio_write() successfully queues the I/O operation,
       the return status of the asynchronous operation will be one of the val‐
       ues 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 contains one  of
       the  values  normally  set  by the write() function call, or one of the
       following:

       EBADF        The  aiocbp→aio_fildes  argument  is  not  a  valid   file
                    descriptor open for writing.


       EINVAL       The  file offset value implied by aiocbp->aio_offset would
                    be invalid.


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



       The   following  condition  may  be  detected  synchronously  or  asyn‐
       chronously:

       EFBIG    The file is a regular file, aiocbp→aio_nbytes is greater  than
                0 and the starting offset in aiocbp→aio_offset is at or beyond
                the offset maximum in the  open  file  description  associated
                with aiocbp→aio_fildes.


USAGE
       The  aio_write()  function has a transitional interface for 64-bit file
       offsets. See lf64(7).

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE  VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe _ Stan‐
       dardSee standards(7).


SEE ALSO
       _Exit(2),  close(2),  fork(2),  lseek(2),   write(2),   aio_cancel(3C),
       aio_error(3C),     aio_read(3C),     aio_return(3C),    lio_listio(3C),
       aio.h(3HEAD), signal.h(3HEAD), attributes(7), lf64(7), standards(7)



Oracle Solaris 11.4               17 Aug 2018                    aio_write(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3