FAT | XFS

aio_set()

PROTOTYPE

#include <posix.h>

int aio_set(const char *path, int num_bufs, int clusts_per_buf);

DESCRIPTION

aio_set() is a non-standard routine that sets the number and size of asynchronous I/O buffers for the volume specified by path, which is either the volume name, the path to any file on the volume, or NULL to select the volume holding the CWD. Paths are absolute if starting with “/”, otherwise they are relative to the CWD.

num_bufs, the number of buffers to allocate, must be greater than one. clusts_per_buf, the number of clusters per buffer, must be greater than or equal to one. The default number of buffers, if aio_set() is not called, is three and their default size is one cluster.

If successful, aio_set() returns 0. Otherwise, it sets errno and returns -1.

ERROR CODES

EINVAL num_bufs is < 2 or clusts_per_buf is < 1.
ENAMETOOLONG A name in path exceeds the effective maximum file name length.
ENOENT path is the empty string or includes a name that was not found.
ENOTDIR One of the non-leaf path components is not a directory.
EROFS The volume is read-only.

EXAMPLE

  /*-------------------------------------------------------------------*/
  /* Set asynchronous I/O buffering characteristics.                   */
  /*-------------------------------------------------------------------*/
  if (aio_set(VolName, NumBufs, MRU_CLUSTS))
    return -1;