29.01.2013 Views

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

gpfs_fputattrs() Subroutine<br />

Name<br />

gpfs_fputattrs() – Sets all the extended file attributes for a file.<br />

Library<br />

<strong>GPFS</strong> Library (libgpfs.a for AIX, libgpfs.so for Linux)<br />

Synopsis<br />

#include <br />

int gpfs_fputattrs(int fileDesc, int flags, void *bufferP)<br />

Description<br />

The gpfs_fputattrs() subroutine, together with gpfs_fgetattrs() is intended for use by a backup program<br />

to save (gpfs_fgetattrs()) <strong>and</strong> restore (gpfs_fputattrs()) extended ACLs defined for the file.<br />

Notes:<br />

1. Compile any program that uses this subroutine with the -lgpfs flag from the following library:<br />

v libgpfs.a for AIX<br />

v libgpfs.so for Linux<br />

Parameters<br />

fileDesc The file descriptor identifying the file whose extended attributes are being set.<br />

flags RESERVED This value must be set to 0.<br />

bufferP A pointer to the buffer containing the extended attributes for the file.<br />

If you specify a value of NULL, all extended ACLs for the file are deleted.<br />

Exit status<br />

If the gpfs_fputattrs() subroutine is successful, it returns a value of 0.<br />

If the gpfs_fputattrs() subroutine is unsuccessful, it returns a value of -1 <strong>and</strong> sets the global error variable<br />

errno to indicate the nature of the error.<br />

Exceptions<br />

None.<br />

Error status<br />

EINVAL The buffer pointed to by bufferP does not contain valid attribute data.<br />

ENOSYS The gpfs_fputattrs() subroutine is not supported under the current file system format.<br />

Examples<br />

To copy extended file attributes from file f1 to file f2:<br />

char buf[4096];<br />

int f1, f2, attrSize, rc;<br />

rc = gpfs_fgetattrs(f1, 0, buf sizeof(buf), &attrSize);<br />

if (rc != 0)<br />

... // error h<strong>and</strong>ling<br />

if (attrSize != 0)<br />

288 <strong>GPFS</strong>: <strong>Administration</strong> <strong>and</strong> <strong>Programming</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!