Behavior changes in other system calls

Although the named data stream directory is hidden from the namespace, it is possible to open the name data stream directory inode with a fchdir() or fchroot() call. Some of the attributes, such as "..", are not defined for a named data streams directory. Any operation that accesses these fields can fail. Attempts to create directories, symbolic links, or device files on a named data stream directory fail. VOP_SETATTR() called on a named data stream directory or named data stream inode also fails.

The following is an alternative method for reading the hidden directory using the fchdir() call:

fd = open(filename, O_RDONLY)
dfd = vxfs_nattr_open(fd, ".", O_RDONLY, mode)
fchdir(dfd);
dirp = opendir(".");
readdir_r(dirp, (struct dirent *)&entry, &result);

Note:

The usage section of the getcwd(3C) man page states that applications should exercise care when using the chdir() call in conjunction with getcwd(). The current working directory is global to all threads within a process. If more than one thread calls chdir() to change the working directory, a subsequent call to getcwd() could produce unexpected results.