Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site ecrcvax.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!mcvax!unido!ecrcvax!pete From: pete@ecrcvax.UUCP (Pete Delaney) Newsgroups: net.unix,net.unix-wizards,net.bugs.4bsd Subject: Bug in ino_select() for machines where sizeof(int) != sizeof(long) Message-ID: <137@ecrcvax.UUCP> Date: Wed, 31-Jul-85 20:00:55 EDT Article-I.D.: ecrcvax.137 Posted: Wed Jul 31 20:00:55 1985 Date-Received: Fri, 2-Aug-85 08:04:10 EDT Reply-To: pete@ecrcvax.UUCP (Pete Delaney) Organization: ECRC, D-8000 Muenchen 81, W. Germany Lines: 47 Keywords: 4bsd, unix, bugs, select, ino_select Xref: linus net.unix:4612 net.unix-wizards:11303 net.bugs.4bsd:1349 There is a small bug in ino_select() for UNIX machines where the sizeof(int) != sizeof(long). The problem is that i_rd is declared as a daddr_t and is cast to a dev_t throughout the kernel (yek!). Anyway, the code in sys_inode.c is missing the cast. __________________________________________________________________________ C O D E ino_select(fp, which) struct file *fp; int which; { register struct inode *ip = (struct inode *)fp->f_data; switch (ip->i_mode & IFMT) { default: return (1); /* XXX */ case IFCHR: return #ifdef KEEP_4BSD_BUG (*cdevsw[major(ip->i_rdev)].d_select)(ip->i_rdev, which); #else (*cdevsw[major(ip->i_rdev)].d_select)((dev_t)ip->i_rdev, which); #endif } } ------------------------------------------------------------------------------- T R A C E I N D I C A T I O N <19550,0X35,pid:60,3 > selscan(): bits:0X00000000 &= ~(1L<<(i:1-1) <19551,0X35,pid:60,4 > ino_select(fp:0X0003EB0A, which:1): entry <19552,0X1A,pid:60,5 > ttselect(dev:0X00000000, rw:1797): entry ^ ^ | | B U G i_rd should be cast to INT!! __________________________________________________________________________ -- -------------------------------------------- Pete Delaney - Rocky Mnt. Unix Consultant Phone: (49) 89 92699-139 European Computer-Industry Research Center UUCP: mcvax!unido!ecrcvax!pete ArabellaStrasse 17 UUCP Domain: pete@ecrcvax.UUCP D-8000 Muenchen 81, West Germany X25: (262)-45890040262 CSNET:pete%ecrcvax.UUCP@Germany.CSNET Login: ------------------------------------------------------------------------------