cd_svd(3X)
cd_svd, cd_csvd --
read CD-ROM Supplementary Volume Descriptors (SVD)
Synopsis
cc [flag . . . ] file . . . -lcdfs -lgen [library] . . .
#include <sys/cdrom.h>
int cd_svd(const char *path, struct iso9660_svd *svd, uint_t *svdloc);
int cd_cpvd(const char *path, char *svd, uint_t *svdloc);
Description
The cd_svd and cd_csvd routines fill the svd
structure with the contents of the first Supplementary Volume Descriptor,
if any exist on the CD-ROM starting from the sector number indicated by
svdloc, that is associated with a file or directory referred to
by path.
If svdloc is NULL or if *svdloc is zero, the starting
sector number is ISO_VD_LOC.
On a successful return if svdloc is defined (i.e., not NULL)
*svdloc is set to the sector number, on the CD-ROM, of the
returned SVD.
In order to read additional SVDs, if they exist on the CD-ROM, increment
*svdloc by one before subsequently calling cd_svd
or cd_csvd.
When there are no more SVDs on the CD-ROM media or image, -1 is returned
and errno
is set to ENOMATCH.
The SVD contains information that the manufacturer recorded on the
CD-ROM disk, such as the location of the root directory, the
block size, volume name and expiration date.
Allocate CD_SVDLEN bytes for the SVD.
To read the SVD, you need read or execute permission for path.
Results are unpredictable if the initial value for the first call
to cd_svd or cd_csvd is not either zero or ISO_VD_LOC.
path-
File or directory within the CD-ROM file system, or block special
file containing the CD-ROM file system.
svd-
Pointer to the structure or character array where
the Supplementary Volume Descriptor is to be copied.
The character array must contain at least CD_SVDLEN bytes.
svd-
On input if defined contains the starting sector number on the CD-ROM
media or image to start searching for a SVD.
On output if defined contains the sector number on the CD-ROM media or
image to where the returned SVD is located.
Return values
On success, cd_svd returns a value of zero and sets
svdloc, if defined, to the sector number of the returned SVD.
On failure, cd_svd returns a value of -1 and sets
errno to identify the error as follows:
EACCES-
Search permission is denied on a component of path,
or read permission is denied on the file,
directory, or block special file that is pointed to by path.
EFAULT-
Invalid address of psd or path.
EINTR-
A signal was caught during the execution of the one of the functions.
EINVAL-
path is a block special file and the CD-ROM is not recorded
according to the ISO-9660 standard.
EINVAL-
path points to a file or directory that is outside the
CD-ROM file system.
EIO -
A valid Volume Descriptor type was not detected.
May occur if svdloc was not initialized properly.
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.
ENOMATCH-
No more SVDs are detected on the CD-ROM media or image.
ENOTDIR-
A component of path is not a directory.
ENXIO-
path is a block special
file and the device associated with the special file does not exist.
ENXIO-
The CD-ROM is not in the drive, or a read error occurred.
References
cdvd(1M),
cd_pvd(3X)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004