test veritas logo



vxfs_nattr_link - link to a named data stream


cc -I /opt/VRTS/include -L /opt/VRTS/lib
-l vxfsutil -ldl

#include <sys/types.h>

#include <vxfsutil.h>

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




The vxfs_nattr_link() function creates a new directory entry for an existing named data stream and increments its link count by one. The spath argument points to the existing named data stream in the named data stream namespace for sfd. tpath points to the new directory entry created in the named data stream name space for sfd.

Linking a named data stream with a prefix of $vxfs: fails with the EINVAL error. The $vxfs: prefix is reserved by Veritas.

The behavior of "" (null string) for named data stream interfaces is same as "." (dot). If a user specifies "" as the path name of a file, the string is treated as "." and the named data stream directory file descriptor is returned.

The "." and ".." strings do not correspond to the current directory and parent directory, respectively, as they do in POSIX UNIX standards. This allows users to create files with these names. However, users should use appropriate names for named data streams that will not be confusing when read from the POSIX UNIX name space perspective.


vxfs_nattr_link() returns zero on success, -1 on failure. If unsuccessful, no link is created and errno is set to indicate the error.


EACCES The specified spath does not exist. The user does not have permission to open or write to the named data stream directory.
EDQUOT The directory for the new link cannot be created because the user quota of disk blocks on that file system was exceeded.
EEXIST The link named by tpath already exists.
EINVAL The file system disk layout version does not support named data streams.
EINVAL Linking a named data stream with a prefix of $vxfs:. The $vxfs: prefix is reserved by Veritas.
ENOSPC There is insufficient space to create a directory for the link.


vxfs_nattr_open(3), vxfs_nattr_rename(3), vxfs_nattr_unlink(3), vxfs_nattr_utimes(3)

VxFS 7.4 vxfs_nattr_link(3)