cd_defs(3X)


cd_defs -- set or get default CD-ROM file permissions, user IDs, and group IDs

Synopsis

   cc [flag . . . ] file . . . -lcdfs -lgen [library] . . .
   

#include <sys/cdrom.h>

int cd_defs(const char *path, int cmd, struct cd_defs *defs);

Description

cd_defs sets or gets the default values of CD-ROM file permissions, directory permissions, user IDs and group IDs. If files or directories do not have permissions, user IDs, or group IDs specified, the system provides default values. cd_defs will modify these values for a mounted file system. cd_defs also allows you to change the definition of search permissions for directories.

cd_defs should be invoked after mounting the CD-ROM, but before opening any files. Permissions that are changed while a file is open will not take effect until the file is closed.


path
Mount point of the CD-ROM file system.

cmd
CD_GETDEFS to get values or CD_SETDEFS to set values.

defs
Pointer to the cd_defs structure that contains values to be set (CD_SETDEFS) or to be filled in with current values (CD_GETDEFS).

Return values

On success, cd_defs returns a value of zero. On failure, cd_defs returns -1 and sets errno to identify the error as follows:


EACCES
Read permission is denied on the mount point, or search permission is denied on a component of path.

EFAULT
Invalid address for the structure defs or path.

EINTR
A signal was caught during the execution of cd_defs.

EINVAL
The path argument does not point to a valid mount point, or the value of cmd is invalid, or a member of the cd_defs structure contains an invalid value.

EMFILE
The maximum number of file descriptors are open.

ENAMETOOLONG
The size of path exceeds MAXPATHLEN, or the component of a path name is longer than MAXNAMELEN while _POSIX_NO_TRUNC is in effect.

ENFILE
The system file table is full.

ENOENT
path does not exist or the path argument points to an empty string.

ENOTDIR
A component of path is not a directory.

EPERM
User lacks write permission to set values.

References

cdmntsuppl(1M), cdfs-specific fs_cdfs(4), mount(1M)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004