ioctl() 64-bit issues

Stasys Smailys ssmailys at komvista.lt
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

sys/ioccom.h
[...]
int ioctl(int, unsigned long, ...);
[...]

usr.sbin/burncd/burncd.c
[...]
int blank, pct, last = 0;
[...]
if (ioctl(fd, CDRIOCGETPROGRESS, &pct) == -1) 

	err(EX_IOERR,"ioctl(CDRIOGETPROGRESS)");
[...]

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: 
http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWdev/SOL64TRANS/p15.html

--
WBR
Stasys Smailys


More information about the freebsd-amd64 mailing list