Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rf_getattr(3P4) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rf_create(3P4)

rf_setattr(3P4)

rf_getattr(3P4)

NAME

rf_getattr − get attributes of realtime file

SYNOPSIS

#include <rtfiles.h>

int rf_getattr(fildes, actattr)
int fildes;
struct rf_attrbuf ∗actattr;

DESCRIPTION

The rf_getattr function allows the calling process to obtain the realtime attributes of the file specified by fildes. 

The attributes of the file will be stored in the rf_attrbuf structure specified by the actattr argument upon successful completion. 

The rf_attrbuf structure is declared in the <rtfiles.h> header file.  The structure has the following members:

off_t    atb_alloc;
int      atb_allocflags;
int      atb_cacheflags;
int      atb_dioflags;
unsigned atb_diosize;

The field atb_alloc will contain the file preallocation size, in bytes.  (For this function, the current size of the file will be returned). 

atb_allocflags contains flags which pertain to file space allocation:

ATB_SEQ
File space for the file was made sequentially.

ATB_ADVSEQ
File space for the file was made sequentially, if possible.  This flag will never be set upon return from this function.

atb_cacheflags contains flags that pertain to the type of caching desired:

ATB_CACHENOREUSE
Recently accessed blocks are not likely to be accessed in the near future.

ATB_CACHERANDOM
Blocks will be accessed randomly.

ATB_CACHESEQUENTIAL
Blocks will be access sequentially.

atb_dioflags contains flags for direct I/O:

ATB_DIOENABLE
Direct I/O will be used for subsequent read and write operations.  Set upon return from this function to indicate that direct I/O is enabled. 

The field atb_diosize contains the direct I/O transfer size in bytes.  Returned as zero to indicate that the underlying file system does not restrict direct I/O to a single transfer size. 

RETURN VALUE

Upon successful completion, the function rf_getattr returns a value of 0;  otherwise it returns a value of -1 and sets errno to indicate theerror. 

ERRORS

Under the following conditions, the function rf_getattr fails and sets errno to:

­[EBADF] The fildes argument is not a valid file descriptor. 

­[EINVAL] The rf_getattr function in not supported for the specified file or file system. 

SEE ALSO

rf_create(3P4), rf_setattr(3P4).

NOTES

The attribute ATB_CACHENOREUSE is not supported on CX systems. 

A file in direct I/O mode does not use the cache.  Upon return, none of the cache flags will be set. 

WARNING

rf_getattr is based on IEEE Draft Standard P1003.4/D12.  This is an unapproved draft, subject to change.  Use of information contained in this unapproved draft is at your own risk.  This interface will change to reflect any changes made by future drafts of POSIX 1003.4. 

CX/UX Programmer’s Reference Manual

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