319 |
|
#else |
320 |
|
fh->cdrom_cap = 0; |
321 |
|
#endif |
322 |
< |
#elif defined(__FreeBSD__) || defined(__NetBSD__) |
322 |
> |
#elif defined(__FreeBSD__) |
323 |
|
fh->is_floppy = ((st.st_rdev >> 16) == 2); |
324 |
|
#ifdef CDIOCCAPABILITY |
325 |
|
if (is_cdrom) { |
329 |
|
#else |
330 |
|
fh->cdrom_cap = 0; |
331 |
|
#endif |
332 |
+ |
#elif defined(__NetBSD__) |
333 |
+ |
fh->is_floppy = ((st.st_rdev >> 16) == 2); |
334 |
|
#endif |
335 |
|
} |
336 |
|
} |
657 |
|
*toc++ = toc_size >> 8; |
658 |
|
*toc++ = toc_size & 0xff; |
659 |
|
return true; |
660 |
< |
#elif defined(__FreeBSD__) || defined(__NetBSD__) |
660 |
> |
#elif defined(__FreeBSD__) |
661 |
|
uint8 *p = toc + 2; |
662 |
|
|
663 |
|
// Header |
700 |
|
|
701 |
|
// TOC size |
702 |
|
int toc_size = p - toc; |
703 |
+ |
*toc++ = toc_size >> 8; |
704 |
+ |
*toc++ = toc_size & 0xff; |
705 |
+ |
return true; |
706 |
+ |
#elif defined(__NetBSD__) |
707 |
+ |
uint8 *p = toc + 2; |
708 |
+ |
|
709 |
+ |
// Header |
710 |
+ |
struct ioc_toc_header header; |
711 |
+ |
if (ioctl(fh->fd, CDIOREADTOCHEADER, &header) < 0) |
712 |
+ |
return false; |
713 |
+ |
*p++ = header.starting_track; |
714 |
+ |
*p++ = header.ending_track; |
715 |
+ |
|
716 |
+ |
// Tracks (this is nice... :-) |
717 |
+ |
struct ioc_read_toc_entry entries; |
718 |
+ |
entries.address_format = CD_MSF_FORMAT; |
719 |
+ |
entries.starting_track = 1; |
720 |
+ |
entries.data_len = 800; |
721 |
+ |
entries.data = (cd_toc_entry *)p; |
722 |
+ |
if (ioctl(fh->fd, CDIOREADTOCENTRIES, &entries) < 0) |
723 |
+ |
return false; |
724 |
+ |
|
725 |
+ |
// TOC size |
726 |
+ |
int toc_size = p - toc; |
727 |
|
*toc++ = toc_size >> 8; |
728 |
|
*toc++ = toc_size & 0xff; |
729 |
|
return true; |