Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

CD_TYPE                           Domain/OS                            CD_TYPE



NAME
     cd_type - get identification of CD-ROM

SYNTAX
     #include <sys/cdrom.h>

     int cd_type(path)
     char *path;

DESCRIPTION
     This function determines the type of CD-ROM. The path argument points to
     a pathname that names a file or directory within a CD-ROM file hierarchy
     or that names a block special file for a CD-ROM file system.  The return
     value of cd_type indicates the type of the CD-ROM.  The definition for
     the return value is contained in <sys/cdrom.h>. This function is intended
     for future expansion, when XCDR may support more CD-ROM types like CD-ROM
     XA.

RETURN VALUE
     Upon successful completion, cd_type returns one of the following values:
     CD_ISO9660 - CD-ROM is recorded according to ISO 9660.  CD_HSG - CD-ROM
     is recorded according to the High Sierra Group.  In case of an error, -1
     is returned and errno is set to indicate the error.

ERRORS
     The cd_type function will fail if one or more of the following is true:

     [EACCESS]
             Search permission is denied for a component of the path
             prefix. Read permission for the file or directory pointed
             to by path or read permission for the block special file
             pointed to by path is denied.

     [ENAMETOOLONG]
             The length of the path string exceeds {PATH_MAX} or a
             pathname component is longer than {NAME_MAX} while
             {_POSIX_NO_TRUNC} is in effect.

     [ENOENT]
             A component of path does not exist or the path
             argument points to an empty string.

     [EINVAL]
             The argument path points to a file/directory not within
             a CD-ROM file hierarchy.

     [ENOTDIR]
             A component of the path prefix is not a directory.

     [ENXIO]
             The named file is a block special file and the device associated
             with the special file does not exist.
             The CD-ROM is not in the drive or a read error occured.

     [EFAULT]
             The address of path is invalid.

     [EINTR]
             A signal was caught during the cd_type() function.

     [EMFILE]
             {OPEN_MAX} file descriptors are currently open in the
             calling process.

     [ENFILE]
             The system file table is full.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026