DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

cd_xar(3X)


cd_xar, cd_cxar -- read CD-ROM Extended Attribute Record (XAR)

Synopsis

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

#include <sys/cdrom.h>

int cd_xar(const char *path, const int fsec, struct iso9660_xar *xar, const int applen, const int esclen);

int cd_cxar(const char *path, const int fsec, char *xar, const int xarlen);

Description

cd_xar fills xar with the contents of the XAR associated with the file or directory referred to by the argument path. An XAR describes attributes of a file or directory (such as the user ID, group ID, or permissions) on an extent, a portion of a file on a CD-ROM. An XAR contains a fixed-length field and two variable length fields. CD_XARFIXL defines the length of the fixed part of the XAR.

You can obtain the total number of an XAR's logical blocks with the cd_drec function. You can obtain the Logical Block Size in bytes with the cd_pvd function.


path
File or directory in the CD-ROM file system.

fsec
Specifies the File Section of that file. The numbering starts with one. If fsec is set to -1, the function reads the XAR of the last File Section of the file.

xar
Pointer to structure or character array where XAR is to be copied.

applen
Bytes to be copied to the address. specified in the xar structure by app_use.

esclen
Bytes to be copied to the address specified in the xar structure by esc_seq.

xarlen
Bytes to be copied to xar.

Return values

On success, cd_xar returns the number of bytes copied for the variable part of the XAR. On success, cd_cxar returns the number of bytes copied. On failure, the functions return -1 and set 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 cd_defs or path.

EINTR
A signal was caught during the execution of one of the functions.

EINVAL
Invalid value for fsec or xarlen.

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.

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, the path argument points to an empty string, or the file section indicated by fsec has no XAR.

ENOTDIR
A component of path is not a directory.

ENXIO
CD-ROM is not in the drive or a read error occurred.

References

cdxar(1M), cd_drec(3X), cd_pvd(3X)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004