Named data streams application programming interface

The following standard system calls can manipulate named data streams:

open()

Opens a named data stream

read()

Reads a named data stream

write()

Writes a named data stream

getdents()

Reads directory entries and puts in a file system independent format

mmap()

Maps pages of memory

readdir()

Reads a directory

VxFS named data stream functionality is available through the following application programming interface functions:

vxfs_nattr_open()

Works similarly to the open() system call, except that the path is interpreted as a named data stream to a file descriptor. If the vxfs_nattr_open() operation completes successfully, the return value is the file descriptor associated with the named data stream. The file descriptor can be used by other input/output functions to refer to that named data stream. If the path of the named data stream is set to ".", the file descriptor returned points to the named data stream directory vnode.

The following is the syntax for the vxfs_nattr_open() API:

int vxfs_nattr_open(int fd, char *path,
         int oflag, int cmode);

vxfs_nattr_link()

Creates a new directory entry for the existing named data stream and increments its link count by one. There is a pointer to an existing named data stream in the named data stream namespace and a pointer to the new directory entry created in the named data stream namespace. The calling function must have write permission to link the named data stream.

The following is the syntax for the vxfs_nattr_link() API:

int vxfs_nattr_link(int sfd, char *spath,
      char *tpath);

vxfs_nattr_unlink()

Removes the named data stream at a specified path. The calling function must have write permission to remove the directory entry for the named data stream.

The following is the syntax for the vxfs_nattr_unlink() API:

int vxfs_nattr_unlink(int fd, char *path);

vxfs_nattr_rename()

Changes a specified namespace entry at path1 to a second specified namespace at path2. The specified paths are resolved relative to a pointer to the named data stream directory vnodes.

The following is the syntax for the vxfs_nattr_rename() API:

int vxfs_nattr_rename(int sfd, char *old,
    char *tnew);

vxfs_nattr_utimes()

Sets the access and modification times of the named data stream.

The following is the syntax for the vxfs_nattr_utimes() API:

int vxfs_nattr_utimes(int sfd,
    const char *path,
    const struct timeval times[2]);

See the vxfs_nattr_open(3), vxfs_nattr_link(3), vxfs_nattr_unlink(3), vxfs_nattr_rename(3), and vxfs_nattr_utimes(3) manual pages.