DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

cd_suf(3X)


cd_suf -- read the cdfs System Use Field from the specified System Use Area

Synopsis

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

#include <sys/cdrom.h>

int cd_suf(const char *path, int fsec, char *signature, int index, char *buf, int buflen);

Description

cd_suf reads a System Use Field of the System Use Area associated with a File Section of a file or directory, following any continuation fields that may be present. A continuation field is a System Use Field that extends the System Use Area so more System Use Fields can be stored. Continuation fields are defined in the System Use Sharing Protocol specification. The System Use Area may be used by the manufacturer to record additional information about files and directories, such as the POSIX file system information.

path
Points to a file or directory within the CD-ROM file hierarchy.

fsec
Identifies the File Section of that file to be used. The numbering starts with 1. If fsec is set to -1, the System Use Area of the last File Section of that file is assumed.

signature
The 2-byte signature word of the requested System Use Field. See cdfs-specific dir_cdfs(4) for a list of the known valid System Use Field values.

index
Specifies the occurrence number of signature to return. If signature is NULL, the index'th occurrence of the System Use Field is returned, starting from the beginning of the SUSP portion of System Use Area. Otherwise, the index'th occurrence of signature is returned. The index number of the first System Use Field of any signature is 1.

buf
Specifies the address of the buffer in which to place the System Use Field.

buflen
Specifies the length of the buffer in which to place the System Use Field.

Return values

On success, cd_suf returns the number of bytes placed in buf. If the signature field is not found, 0 is returned. On failure, cd_suf returns -1 and sets errno to indicate the error as follows:

EACCES
Search permission for a component of the path prefix is denied.

EACCES
Read permission on the file or directory pointed to by path is denied.

EFAULT
The address of buf, signature or path is invalid.

EINTR
A signal was caught during the cd_suf function.

EINVAL
The value of fsec, index or buflen is invalid.

EINVAL
The path argument points to a file or directory that is not within the CD-ROM file hierarchy.

EMFILE
Too many file descriptors are currently open in the calling process.

ENAMETOOLONG
The length of the path string exceeds MAXPATHLEN.

ENAMETOOLONG
A pathname component is longer than MAXNAMELEN while _POSIX_NO_TRUNC is in effect.

ENFILE
The system file table is full.

ENODEV
The Volume containing the File Section indicated by fsec is not mounted.

ENOENT
A component of path does not exist.

ENOENT
The path argument points to an empty string.

ENOENT
The File Section indicated by fsec has no System Use Area.

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

ENXIO
The CD-ROM is not in the drive.

EIO
A read error occurred.

References

cddevsuppl(1M), cdsuf(1M), cdfs-specific dir_cdfs(4)

Rock Ridge Interchange Protocol and the System Use Sharing Protocol from the Rock Ridge Technical Working Group


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004