ioctl() 64-bit issues

Stasys Smailys ssmailys at
Tue Nov 2 11:16:34 PST 2004

Hi, all!

I think we have a problem here at least it seems so to me. Trying to fix 
an infinite loop that occured in usr.sbin/burncd/burncd.c when I have 
tried to blank cdrw disc I discovered that

int ioctl(int, unsigned long, ...);

int blank, pct, last = 0;
if (ioctl(fd, CDRIOCGETPROGRESS, &pct) == -1) 


always returns a zero value in pct (pct == 0). By the way there is a 
typo in burncd.c: the second CDRIOCGETPROGRESS misses 'C'. Anyway it is 
not essential. As you can see by yourself in that case the loop becomes 
infinite. Further investigations showed me that pct gets overwritten 
every ioctl's call by CDRIOCGETPROGRESS constant's upper bytes. At the 
moment of ioctl's call the CDRIOCGETPROGRESS value is 0x0000004004636f.

I suppose this is not the only case. May be this case and PR amd64/69704 
(ext2/ext3 unstable in amd64) are interconnected somehow, because both 
use sys/ioccom.h. May be some others too. I don't know.

Here is something to start:

Stasys Smailys

More information about the freebsd-amd64 mailing list