cd_type(3X) cd_type(3X)
NAME
cd_type - get CD-ROM format identification
SYNOPSIS
cc [flag . . . ] file . . . -lcdfs -lgen [library] . . .
#include <sys/cdrom.h>
int cd_type(const char *path);
DESCRIPTION
cd_type determines the type of a CD-ROM and indicates the CD-
ROM type in the return value.
path File or directory within the CD-ROM file system, or
block special file containing the CD-ROM file
system.
Return Values
On success, cd_type returns one of the following values:
CD_IS09660
The CD-ROM is recorded according to ISO-9660.
CDFS_HIGH_SIERRA
The CD-ROM is recorded according to High Sierra.
CDFS_UNDEF_FS_TYPE
The CD-ROM is recorded according to an unknown
specification.
On failure, cd_type returns -1 and sets errno to indicate the
error.
Errors
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 path.
EINVAL path points to a file or directory that is outside
the CD-ROM file system.
EMFILE The maximum number of file descriptors are open.
Copyright 1994 Novell, Inc. Page 1
cd_type(3X) cd_type(3X)
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.
ENXIO path is a block special file and the device
associated with it does not exist.
ENXIO The CD-ROM is not in the drive or a read error
occurred.
Copyright 1994 Novell, Inc. Page 2