xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ddlpa_1.h File Reference

Go to the source code of this file.

Data Structures

struct  ddlpa_lock
 

Macros

#define DDLPA_H_NOT_ENCAPSULATED   1
 
#define DDLPA_MAX_STD_LEN   15
 
#define DDLPA_MAX_SIBLINGS   5
 
#define DDLPA_OPEN_GIVEN_PATH   1
 
#define DDLPA_ALLOW_MISSING_SGRCD   2
 

Functions

int ddlpa_lock_path (char *path, int o_flags, int ddlpa_flags, struct ddlpa_lock **lockbundle, char **errmsg)
 
int ddlpa_lock_btl (int bus, int target, int lun, int o_flags, int ddlpa_flags, struct ddlpa_lock **lockbundle, char **errmsg)
 
int ddlpa_destroy (struct ddlpa_lock **lockbundle)
 

Macro Definition Documentation

◆ DDLPA_ALLOW_MISSING_SGRCD

#define DDLPA_ALLOW_MISSING_SGRCD   2

Definition at line 155 of file ddlpa_1.h.

◆ DDLPA_H_NOT_ENCAPSULATED

#define DDLPA_H_NOT_ENCAPSULATED   1

Definition at line 14 of file ddlpa_1.h.

◆ DDLPA_MAX_SIBLINGS

#define DDLPA_MAX_SIBLINGS   5

Definition at line 32 of file ddlpa_1.h.

◆ DDLPA_MAX_STD_LEN

#define DDLPA_MAX_STD_LEN   15

Definition at line 29 of file ddlpa_1.h.

◆ DDLPA_OPEN_GIVEN_PATH

#define DDLPA_OPEN_GIVEN_PATH   1

Definitions of macros used in above functions

Definition at line 154 of file ddlpa_1.h.

Function Documentation

◆ ddlpa_destroy()

int ddlpa_destroy ( struct ddlpa_lock **  lockbundle)

Release the lock by closing all filedescriptors and freeing memory.

Parameters
lockbundlethe lock which is to be released. lockbundle will be set to NULL by this call.
Returns
0=success , 1=failure

Definition at line 425 of file ddlpa.c.

References ddlpa_lock::errmsg, ddlpa_lock::fd, ddlpa_lock::num_siblings, ddlpa_lock::path, and ddlpa_lock::sibling_fds.

Referenced by ddlpa_lock_btl(), and ddlpa_lock_path().

◆ ddlpa_lock_btl()

int ddlpa_lock_btl ( int  bus,
int  target,
int  lun,
int  o_flags,
int  ddlpa_flags,
struct ddlpa_lock **  lockbundle,
char **  errmsg 
)

Lock a recorder by naming a Bus,Target,Lun number triple. Allocate a new container.

Parameters
busparameter to match ioctl(SCSI_IOCTL_GET_BUS_NUMBER)
targetparameter to match ioctl(SCSI_IOCTL_GET_IDLUN) &0xff
lunparameter to match ioctl(SCSI_IOCTL_GET_IDLUN) &0xff00
o_flagsflags for open(2)
ddlpa_flagssee ddlpa_lock_path(). Flag DDLPA_OPEN_GIVEN_PATH will be ignored.
lockbundlesee ddlpa_lock_path().
errmsgsee ddlpa_lock_path().
Returns
0=success , 1=failure

Lock a recorder by naming a Bus,Target,Lun number triple. Allocate a new container.

Parameters
busparameter to match ioctl(SCSI_IOCTL_GET_BUS_NUMBER)
targetparameter to match ioctl(SCSI_IOCTL_GET_IDLUN) &0xff
lunparameter to match ioctl(SCSI_IOCTL_GET_IDLUN) &0xff00
o_flagssee ddlpa_lock_path().
ddlpa_flagssee ddlpa_lock_path(). Flag DDLPA_OPEN_GIVEN_PATH will be ignored.
lockbundlesee ddlpa_lock_path().
errmsgsee ddlpa_lock_path().
Returns
0=success , else an errno compatible error number

Definition at line 480 of file ddlpa.c.

References ddlpa_lock::bus, ddlpa_destroy(), ddlpa_lock::ddlpa_flags, ddlpa_new(), ddlpa_open_all(), DDLPA_OPEN_GIVEN_PATH, ddlpa_std_by_btl(), ddlpa_lock::errmsg, ddlpa_lock::in_bus, ddlpa_lock::in_lun, ddlpa_lock::in_target, ddlpa_lock::inbtl_is_valid, ddlpa_lock::lun, and ddlpa_lock::o_flags.

◆ ddlpa_lock_path()

int ddlpa_lock_path ( char *  path,
int  o_flags,
int  ddlpa_flags,
struct ddlpa_lock **  lockbundle,
char **  errmsg 
)

Lock a recorder by naming a device file path. Allocate a new container.

Parameters
pathGives the file system path of the recorder as known to the calling program.
o_flagsflags for open(2)
ddlpa_flags0 = default behavior: the standard path will be opened and treated by fcntl(F_SETLK) DDLPA_OPEN_GIVEN_PATH causes the input parameter "path" to be used with open(2) and fcntl(2). Caution: This weakens the fcntl part of DDLP-A. DDLPA_ALLOW_MISSING_SGRCD allows to grant a lock although not both, a sg and a sr|scd device, have been found during sibling search. Normally this is counted as failure due to EBUSY.
lockbundlegets allocated and then represents the locking state
errmsgif *errmsg is not NULL after the call, it contains an error message. Then to be released by free(3). It is NULL in case of success or lack of memory.
Returns
0=success , 1=failure

Lock a recorder by naming a device file path. Allocate a new container.

Parameters
pathGives the file system path of the recorder as known to the calling program.
o_flagsflags for open(2). Do not use O_EXCL here because this is done automatically whenever appropriate. Advised is O_RDWR | O_LARGEFILE, eventually | O_NDELAY.
ddlpa_flags0 = default behavior: the standard path will be opened and treated by fcntl(F_SETLK) DDLPA_OPEN_GIVEN_PATH causes the input parameter "path" to be used with open(2) and fcntl(2). DDLPA_ALLOW_MISSING_SGRCD allows to grant a lock although not all three, a sg, a sr and a scd device file have been found during sibling search. Normally this is counted as failure due to EBUSY.
lockbundlegets allocated and then represents the locking state
errmsgif *errmsg is not NULL after the call, it contains an error message. Then to be released by free(3). It is NULL in case of success or lack of memory.
Returns
0=success , else an errno compatible error number

Definition at line 448 of file ddlpa.c.

References ddlpa_destroy(), ddlpa_lock::ddlpa_flags, ddlpa_new(), ddlpa_open_all(), ddlpa_std_by_rdev(), ddlpa_lock::errmsg, ddlpa_lock::o_flags, ddlpa_lock::path, and ddlpa_lock::path_is_valid.