I have run into an issue that has me stumped. The following code runs fine when the standalone application is run from Xcode, but when I run it in the debugger the second ioctl() fails (the DKIOCCDREADTOC):
int fd = -1;
fd = opendev("disk1", O_RDONLY | O_NONBLOCK, 0, NULL);
if(-1 == fd) { perror("unable to open the drive for reading"); }
dk_cd_read_toc_t cd_read_toc; uint8_t buffer [2048];
bzero(&cd_read_toc, sizeof(cd_read_toc)); bzero(buffer, sizeof(buffer));
cd_read_toc.format = kCDTOCFormatTOC; cd_read_toc.formatAsTime = 1; cd_read_toc.address.track = 0; cd_read_toc.buffer = buffer; cd_read_toc.bufferLength = sizeof(buffer);
if(-1 == ioctl(fd, DKIOCCDREADTOC, &cd_read_toc)) { perror("unable to read TOC"); }
close(fd);
Has anyone experienced issues like this before?
I'm running Xcode 2.3 on a 1.67 GHz PowerBook G4, 10.4.6
Thanks, Stephen |