lkml.org 
[lkml]   [1996]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectint-long confusion in some ioctls

Hello Hackers,

I've found a handful of ioctl calls that write an either an int or a
long into the calling process's address space, depending on which driver
implements the ioctl.

For example, TIOCOUTQ usually has this interface:

int i;
ioctl( fd, TIOCOUTQ, &i );

But some drivers implement this interface:

long l;
ioctl( fd, TIOCOUTQ, &l );

This is harmless on i386 but I think it will cause problems on the alpha
and other 64-bit architectures.

The ioctls are:

TIOCOUTQ TIOCINQ
TIOCMGET TIOCMBIS TIOCMBIC TIOCMSET
TIOCGSOFTCAR TIOCSSOFTCAR TIOCSERGETLSR
BLKGETSIZE BLKRAGET

Two questions:

(1) Is my analysis correct, that this really will cause problems
in 64-bit Linux?

(2) Have these ioctls been standardized somewhere, so that I can
tell whether 'int *' or 'long *' is the right type for each one?

Michael Chastain
mec@shout.net

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.060 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site