ffiolock

Date:

10-20-2011

NAME

ffiolock, ffiounlock - Provides locking for FFIO functions

SYNOPSIS

#include <ffio.h>
int ffiolock (int fd, struct ffsw *status);
int ffiounlock (int fd, struct ffsw *status);

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The ffiolock and ffiounlock functions provide a way of locking a group of Flexible File I/O (FFIO) function calls that use the same fd. The ffiolock function sets a lock; any other task that issues an FFIO call with the same fd will wait until the lock is released. Function ffiounlock releases the lock.

Arguments to ffiolock are as follows:

fd

Value returned from an ffopen or ffopens call.

status

Pointer to the ffsw status return structure, described in detail in ffread(3c).

The description of handling asynchronous FFIO is given under ffread(3c).

RETURN VALUES

In case of error, both functions return -1 and the ffsw.sw_error field contains the error value. Otherwise, 0 is returned. If status is NULL, the error value is returned in errn0.