vxfs_nattr_open - open a named data stream
cc -I /opt/VRTS/include -L /opt/VRTS/lib
-l vxfsutil -ldld
int vxfs_nattr_open(int fd, char *path, int *oflag, int mode);
The vxfs_nattr_open() function returns an open file descriptor for the named data stream pointed to by path for the file descriptor fd. vxfs_nattr_open() operates like the open() call, except that the path is interpreted as a named data stream to the file descriptor fd.
If the path is set to "." (dot), the returned file descriptor points to the named data stream directory.
Values for oflag are constructed by a bit-wise inclusive or of flags from the following list (defined in <fcntl.h>). Applications must specify one of the following three file access modes for oflag:
Open for reading only.
Open for writing only.
Open for reading and writing.
Any combination of the following can be used:
If specified, the file offset is set to the end of the file before each write operation.
Creates the named data stream. If the file already exists, O_CREAT has no effect except as described under O_EXCL below.
If O_CREAT and O_EXCL are set, vxfs_nattr_open() fails if the file exists. If O_CREAT is not set, the effect is undefined.
Write I/O operations on the file descriptor complete as defined by synchronized I/O data integrity guarantees.
Read I/O operations on the file descriptor complete at the same level of data integrity specified by the O_DSYNC and O_SYNC flags.
If either O_DSYNC or O_SYNC and O_RSYNC are set in oflags, all I/O operations on the file descriptor complete as defined by synchronized I/O data integrity guarantees.
If O_SYNC is set on a named data stream, write operations to that file cause the process to block until the data is written to the underlying hardware.
If the file exists and is successfully opened with O_RDWR or O_WRONLY, the file length is truncated to zero. The result of using O_TRUNC with O_RDONLY is undefined.
If O_LARGEFILE is specified, the named data stream is created with support for large files.
Some flag values can be set following vxfs_nattr_open() similar to that of the fcntl function.
Opening a named data stream with a prefix of $vxfs: fails with the EINVAL error. The $vxfs: prefix is reserved by Symantec.
Upon successful completion, vxfs_nattr_open() opens the file and returns a non-negative integer representing the lowest numbered unused file descriptor. Otherwise, -1 is returned, errno is set to indicate the error, and no files are created or modified.
Search permission does not exist on the attribute directory. The file exists but the permissions specified by oflag are insufficient. The file does not exist and write permission is insufficient for the attribute directory associated with the file descriptor. O_TRUNC is specified and the user does not have write permission.
The file does not exist. O_CREAT was specified and the user quota of inodes or disk blocks was exceeded on the file system where the file was being created.
The O_CREAT and O_EXCL flags are set and the named data stream already exists.
The value of oflag is not valid. The file system disk layout version does not support named data streams.
OPEN_MAX file descriptors are currently open in the calling process.
The maximum number of files are open on the system.
The O_CREAT flag is not set and the named file does not exist. The O_CREAT flag is set and either the path does not exist or the path points to an empty string.
The path argument names a STREAMS file and the system is unable to allocate resources.
There is insufficient space in the directory or file system to create the file. O_CREAT is specified and the file does not exist.
The path name resolution of a symbolic link produced an intermediate result whose length exceeded PATH_MAX.
The named file is a regular file and either O_LARGEFILE is not set or the size of the file cannot be represented correctly in an object of type off_t. O_LARGEFILE is set and the size of the file cannot be represented correctly in an object of type off64_t.
fcntl(2), vxfs_nattr_link(3), vxfs_nattr_rename(3), vxfs_nattr_unlink(3) vxfs_nattr_utimes(3)