06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

pHILE+ <strong>System</strong> <strong>Calls</strong> access_f<br />

access_f Determines the accessibility of a file.<br />

#include <br />

unsigned long access_f(<br />

char *name, /* file pathname */<br />

int mode /* file mode to check */<br />

)<br />

Volume Types<br />

Description<br />

Arguments<br />

Return Value<br />

NFS formatted volumes.<br />

access_f() checks the named file for accessibility according to mode.<br />

name Points to a null-terminated pathname of a file to be checked.<br />

mode Specifies the file mode to check. mode is the result of an OR operation<br />

performed on the following constants (defined in .)<br />

Hex Mnemonic Description<br />

4 R_OK Test for read permission.<br />

2 W_OK Test for write permission.<br />

1 X_OK Test for execute/search permission.<br />

0 F_OK Test for presence of file.<br />

This system call returns 0 on success, or an error code on failure.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 2-5<br />

2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!