Changeset View
Changeset View
Standalone View
Standalone View
stand/libsa/cd9660.c
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
} ISO_SUSP_PRESENT; | } ISO_SUSP_PRESENT; | ||||
static int buf_read_file(struct open_file *f, char **buf_p, | static int buf_read_file(struct open_file *f, char **buf_p, | ||||
size_t *size_p); | size_t *size_p); | ||||
static int cd9660_open(const char *path, struct open_file *f); | static int cd9660_open(const char *path, struct open_file *f); | ||||
static int cd9660_close(struct open_file *f); | static int cd9660_close(struct open_file *f); | ||||
static int cd9660_read(struct open_file *f, void *buf, size_t size, | static int cd9660_read(struct open_file *f, void *buf, size_t size, | ||||
size_t *resid); | size_t *resid); | ||||
static int cd9660_write(struct open_file *f, const void *buf, size_t size, | |||||
size_t *resid); | |||||
static off_t cd9660_seek(struct open_file *f, off_t offset, int where); | static off_t cd9660_seek(struct open_file *f, off_t offset, int where); | ||||
static int cd9660_stat(struct open_file *f, struct stat *sb); | static int cd9660_stat(struct open_file *f, struct stat *sb); | ||||
static int cd9660_readdir(struct open_file *f, struct dirent *d); | static int cd9660_readdir(struct open_file *f, struct dirent *d); | ||||
static int dirmatch(struct open_file *f, const char *path, | static int dirmatch(struct open_file *f, const char *path, | ||||
struct iso_directory_record *dp, int use_rrip, int lenskip); | struct iso_directory_record *dp, int use_rrip, int lenskip); | ||||
static int rrip_check(struct open_file *f, struct iso_directory_record *dp, | static int rrip_check(struct open_file *f, struct iso_directory_record *dp, | ||||
int *lenskip); | int *lenskip); | ||||
static char *rrip_lookup_name(struct open_file *f, | static char *rrip_lookup_name(struct open_file *f, | ||||
struct iso_directory_record *dp, int lenskip, size_t *len); | struct iso_directory_record *dp, int lenskip, size_t *len); | ||||
static ISO_SUSP_HEADER *susp_lookup_record(struct open_file *f, | static ISO_SUSP_HEADER *susp_lookup_record(struct open_file *f, | ||||
const char *identifier, struct iso_directory_record *dp, | const char *identifier, struct iso_directory_record *dp, | ||||
int lenskip); | int lenskip); | ||||
struct fs_ops cd9660_fsops = { | struct fs_ops cd9660_fsops = { | ||||
"cd9660", | "cd9660", | ||||
cd9660_open, | cd9660_open, | ||||
cd9660_close, | cd9660_close, | ||||
cd9660_read, | cd9660_read, | ||||
cd9660_write, | null_write, | ||||
cd9660_seek, | cd9660_seek, | ||||
cd9660_stat, | cd9660_stat, | ||||
cd9660_readdir | cd9660_readdir | ||||
}; | }; | ||||
#define F_ISDIR 0x0001 /* Directory */ | #define F_ISDIR 0x0001 /* Directory */ | ||||
#define F_ROOTDIR 0x0002 /* Root directory */ | #define F_ROOTDIR 0x0002 /* Root directory */ | ||||
#define F_RR 0x0004 /* Rock Ridge on this volume */ | #define F_RR 0x0004 /* Rock Ridge on this volume */ | ||||
▲ Show 20 Lines • Show All 451 Lines • ▼ Show 20 Lines | else | ||||
d->d_type = DT_REG; | d->d_type = DT_REG; | ||||
d->d_namlen = namelen; | d->d_namlen = namelen; | ||||
bcopy(name, d->d_name, d->d_namlen); | bcopy(name, d->d_name, d->d_namlen); | ||||
d->d_name[d->d_namlen] = 0; | d->d_name[d->d_namlen] = 0; | ||||
fp->f_off += isonum_711(ep->length); | fp->f_off += isonum_711(ep->length); | ||||
return (0); | return (0); | ||||
} | |||||
static int | |||||
cd9660_write(struct open_file *f __unused, const void *buf __unused, | |||||
size_t size __unused, size_t *resid __unused) | |||||
{ | |||||
return EROFS; | |||||
} | } | ||||
static off_t | static off_t | ||||
cd9660_seek(struct open_file *f, off_t offset, int where) | cd9660_seek(struct open_file *f, off_t offset, int where) | ||||
{ | { | ||||
struct file *fp = (struct file *)f->f_fsdata; | struct file *fp = (struct file *)f->f_fsdata; | ||||
switch (where) { | switch (where) { | ||||
Show All 30 Lines |