1
Here is the Fortran interface. Below this is the C interface with
2
a full description of each parameter.
7
All functions return an integer error code with the value zero
8
implying success, non-zero implying some error condition. Offsets are
9
doubles and an offset with a fractional component generates an error.
11
The include file "eaf.fh" defines all of the functions along with
12
EAF_R, EAF_W and EAF_rw.
14
integer function eaf_write(fd, offset, buf, bytes)
15
integer function eaf_read (fd, offset, buf, bytes)
16
integer function eaf_awrite(fd, offset, buf, bytes, req_id)
17
integer function eaf_aread (fd, offset, buf, bytes, req_id)
18
integer function eaf_wait(fd, req_id)
19
integer function eaf_probe(req_id, status)
20
integer function eaf_open(fname, type, fd)
21
[type can be one of EAF_R, EAF_RW, and EAF_W]
22
integer function eaf_close(fd)
23
integer function eaf_delete(fname)
24
integer function eaf_length(fd)
25
integer function eaf_truncate(fd, offset)
26
logical function eaf_eof(ierr)
27
Returns true if ierr corresponds to EOF
28
subroutine eaf_errmsg(ierr,message)
29
Returns a string interpretation of the error code, or
30
an empty string (Fortran all blanks, C null first character)
31
if the error code is not recognized.
32
integer function eaf_stat(fname, avail, fstype)
33
subroutine eaf_print_stats(fd)
40
int eaf_open(const char *fname, int type, int *fd)
42
Open the named file returning the EAF file descriptor in fd.
43
Return 0 on success, non-zero on failure
46
void eaf_print_stats(int fd)
48
Print performance statistics for this file to standard output
53
Close the EAF file and return 0 on success, non-zero on failure
56
int eaf_write(int fd, eaf_off_t offset, const void *buf, size_t bytes)
58
Write the buffer to the file at the specified offset.
59
Return 0 on success, non-zero on failure
62
int eaf_awrite(int fd, eaf_off_t offset, const void *buf, size_t bytes,
65
Initiate an asynchronous write of the buffer to the file at the
66
specified offset. Return in *req_id the ID of the request for
67
subsequent use in eaf_wait/probe. The buffer may not be reused until
68
the operation has completed.
69
Return 0 on success, non-zero on failure
72
int eaf_read(int fd, eaf_off_t offset, void *buf, size_t bytes)
74
Read the buffer from the specified offset in the file.
75
Return 0 on success, non-zero on failure
78
int eaf_aread(int fd, eaf_off_t offset, void *buf, size_t bytes,
81
Initiate an asynchronous read of the buffer from the file at the
82
specified offset. Return in *req_id the ID of the request for
83
subsequent use in eaf_wait/probe. The buffer may not be reused until
84
the operation has completed.
85
Return 0 on success, non-zero on failure
88
int eaf_wait(int fd, int req_id)
90
Wait for the I/O operation referred to by req_id to complete.
91
Return 0 on success, non-zero on failure
94
int eaf_probe(int req_id, int *status)
96
*status returns 0 if the I/O operation reffered to by req_id
97
is complete, 1 otherwise.
98
Return 0 on success, non-zero on failure.
101
int eaf_delete(const char *fname)
103
Delete the named file. If the delete succeeds, or the file
104
does not exist, return 0. Otherwise return non-zero.
107
int eaf_length(int fd, eaf_off_t *length)
109
Return in *length the length of the given file. Reutrn 0 on
110
success, non-zero on failure
113
int eaf_stat(const char *path, int *avail_kb, char *fstype, int fslen)
115
Return in *avail_kb and *fstype the amount of free space (in Kb)
116
and filesystem type (currenly UFS, PFS, or PIOFS) of the filesystem
117
associated with path. Path should be either a filename, or a directory
118
name ending in a slash (/). fslen should specify the size of the
119
buffer pointed to by fstype.
121
Return 0 on success, non-zero on failure.
124
int eaf_eof(int code)
126
Return 0 if code corresponds to EOF, or non-zero.
129
void eaf_errmsg(int code, char *msg)
131
Return in msg (assumed to hold up to 80 characters)
132
a description of the error code obtained from an EAF call,
133
or an empty string if there is no such code