sam_rearch - Sets rearchive attributes on a file or directory
cc [ flag
… ] file
… -L∕opt∕SUNWsamfs∕lib -lsam [ library … ]
#include "∕opt∕SUNWsamfs∕include∕lib.h"
int sam_rearch(const char * path ,
int num_opts ,
…);
sam_rearch()
sets rearchive attributes on a file or directory using
an Oracle HSM system call.
path
is the file on which to set the attributes,
followed by a sequence of
num_opts
input characters or options.
Individual options are described below.
c copy_noSpecifies the archive copy number.
If one or more 'c' options are specified,
only those archive copies (1, 2, 3 or 4) are marked.
If not specified, the default is all copies only
in the case that media type and VSN are
specified, using the "m media" option and "v vsn" option.
MRearchives metadata only. This includes directories, the segment index, and removable media files. Regular files and symbolic links are not rearchived.
m mediaSpecifies the media type.
If specified, archive copies on the specified media are marked.
This option must be specified in conjunction with
the "v vsn" option.
For more information on media types, see the mcf (4) man page.
oRequires the file to be online before its archive entry is rearchived. If the file is offline, the function stages the file onto disk before rearchiving any entries.
v vsnMarks archive copies on VSN vsn for rearchiving.
This option must be specified in conjunction with
the "m media" option.
Upon successful completion a value of 0 is returned.
Otherwise, a value of -1 is returned and
errno
is set to indicate the error.
sam_rearch()
fails if one or more of the following are true:
EINVALAn invalid option was specified, or the file is neither a regular file nor a directory.
EPERMNot the owner or super-user.
EFAULTArgument points to an illegal address.
EINTRA signal was caught during the
sam_rearch()
function.
ELOOPToo many symbolic links were encountered in translating path.
ENAMETOOLONGThe length of the
path
argument exceeds {PATH_MAX}, or the
length of a path component exceeds {NAME_MAX} while
{_POSIX_NO_TRUNC} is in effect.
ENOENTThe named file does not exist or is the null pathname.
ENOLINKpath points to a remote machine and the link to that machine is no longer active.
ENOTDIRA component of the path prefix is not a directory.