Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ aio_fsync(3R) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fcntl(2)

open(2)

read(2)

write(2)

aio_error(3R)

aio_return(3R)

fdatasync(3R)

fsync(3C)

attributes(5)

fcntl(5)

interface64(5)

standards(5)

aio_fsync(3R)

NAME

aio_fsync − asynchronous file synchronization

SYNOPSIS

cc [ flag ... ] file ... −lposix4 [ library ... ]

#include <aio.h>

int aio_fsync(int op, aiocb ∗aiocbp);

DESCRIPTION

The aio_fsync() function queues an asynchronous fsync(3C) or fdatasync(3R) request for all the currently queued I/O operations on the file referenced by aiocbp->aio_fildes, and returns control immediately.  This request is serviced concurrently with other activity of the process.  If op is O_DSYNC, all I/O operations are completed by a call to fdatasync(3R) (synchronized I/O data integrity completion).  If op is O_SYNC, all I/O operations are completed by a call to fsync(3C) (synchronized I/O file integrity completion).  (see fcntl(5) definitions of O_DSYNC and O_SYNC.) 

When the request is queued, the error status for the operation is EINPROGRESS.  When all data has been successfully transferred, the error status is reset to reflect the success or failure of the operation.  The aio_return(3R) and aio_error(3R) functions may be used with this aiocbp value to monitor both the return and the error status of the asynchronous operation while it is proceeding. 

aiocbp->aio_sigevent defines the signal to be generated upon I/O completion. 
If aiocbp-> aio_sigevent.sigev_signo is non-zero, then a signal will be generated when all I/O operations have achieved syncronized I/O completion. 

struct aiocb {

  int aio_fildes; /∗ file descriptor ∗/
  volatile void ∗aio_buf; /∗ buffer location ∗/
  size_t aio_nbytes; /∗ length of transfer ∗/
  off_t aio_offset; /∗ file offset ∗/
  int aio_reqprio; /∗ request priority offset ∗/
  struct sigevent aio_sigevent; /∗ signal number and offset ∗/
  int aio_lio_opcode; /∗ listio operation ∗/

};

struct sigevent {

  int sigev_notify; /∗ notification mode ∗/
  int sigev_signo; /∗ signal number ∗/
  union sigval sigev_value; /∗ signal value ∗/

};

union sigval {

  int sival_int; /∗ integer value ∗/
  void ∗sival_ptr; /∗ pointer value ∗/

};

RETURN VALUES

If the I/O operation is successfully queued, aio_fsync() returns 0.  Otherwise, it returns −1, and sets errno to indicate the error condition. 

ERRORS

The aio_fsync() function will fail if:

EAGAIN The requested asynchronous operation was not queued due to temporary resource limitations. 

EBADF aiocbp-> aio_fildes is not a valid file descriptor open for writing. 

EINVAL Synchronized I/O is not supported for this file, or a value of op other than O_DSYNC or O_SYNC was specified. 

ENOSYS aio_fsync() is not supported by this implementation. 

USAGE

The aio_fsync() function has an explicit 64-bit equivalent.  See interface64(5). 

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
MT-Level MT-Safe

SEE ALSO

fcntl(2), open(2), read(2), write(2), aio_error(3R), aio_return(3R), fdatasync(3R), fsync(3C), attributes(5), fcntl(5), interface64(5), standards(5)

NOTES

If aio_fsync() fails, outstanding I/O operations are not guaranteed to have been completed. 

Applications compiled under Solaris 2.3 and 2.4 and using POSIX (see standards(5)) Asynchronous Input and Output option must be recompiled to work correctly when Solaris supports this option. 

BUGS

In Solaris 2.5, these functions always return −1 and set errno to ENOSYS, because this release does not support the Asynchronous Input and Output option.  It is our intention to provide support for these interfaces in future releases. 

SunOS 5.6  —  Last change: 30 Dec 1996

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