linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem with ioctl command TCGETS
@ 2004-11-28  0:22 Ozan Eren Bilgen
  2004-11-28  0:39 ` Al Viro
  0 siblings, 1 reply; 28+ messages in thread
From: Ozan Eren Bilgen @ 2004-11-28  0:22 UTC (permalink / raw)
  To: Linux Kernel Maillist

--- Please CC me your responses ---


Hi,

While tracking KPPP and modem interaction, I experienced a problem with
TCGETS ioctl command, which is defined as constant number 0x5401 in
"include/asm/ioctls.h".  If you decode TCGETS, you will obtain:

	type: 'T'
 	direction: _IOC_NONE
	number: 1
	size: 0

but applications (like KPPP) cause indirectly that the modem descriptor
is ioctl'd by passing a string, as the example in
http://www.ussg.iu.edu/hypermail/linux/kernel/9904.0/0371.html shows: 

	fd = open("/dev/ttyS1", O_RDWR|O_NONBLOCK)
	fcntl(fd, F_GETFD)
	fcntl(fd, F_SETFD, FD_CLOEXEC)
	fcntl(fd, F_GETFL)
	ioctl(fd, TCGETS, {B9600 opost isig icanon echo ...}) = 0
	
CMIIW, TCGETS ioctl command should not interest with its argp, but
drivers/char/tty_ioctl.c does.

	case TCGETS:
		if (kernel_termios_to_user_termios((struct termios __user *)arg,
real_tty->termios))
			return -EFAULT;
		return 0;

I have a few questions:

1. Is it nice to break _IO macros?
2. If it has a historical reason, shall I forget to trust to the
informations that I decoded using _IO* macros?
3. Is there a list of such amazing commands?



Thanks in advance,
Ozan Eren BILGEN



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2004-12-10  4:01 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-28  0:22 Problem with ioctl command TCGETS Ozan Eren Bilgen
2004-11-28  0:39 ` Al Viro
2004-11-28  9:59   ` Miklos Szeredi
2004-11-28 10:08     ` Jan Engelhardt
2004-11-28 10:18       ` Miklos Szeredi
2004-11-28 10:28     ` Bernd Eckenfels
2004-11-28 10:56       ` Wichert Akkerman
2004-11-28 11:52         ` Bernd Eckenfels
2004-11-28 11:22       ` Miklos Szeredi
2004-11-28 12:18         ` Al Viro
2004-11-28 12:32           ` Miklos Szeredi
2004-11-28 12:48             ` Al Viro
2004-11-28 12:52               ` Miklos Szeredi
2004-11-28 13:03                 ` Al Viro
2004-11-28 14:30                   ` Tomas Carnecky
2004-11-28 15:27                     ` Al Viro
2004-11-28 18:23                       ` Tomas Carnecky
2004-11-28 18:51                         ` Miklos Szeredi
2004-12-10  4:01                   ` Ingo Oeser
2004-11-28 13:20                 ` Tomas Carnecky
2004-11-28 14:05                   ` Al Viro
2004-11-28 13:07           ` Tomas Carnecky
2004-11-28 13:11             ` Al Viro
2004-11-28 13:19               ` Tomas Carnecky
2004-11-28 17:42           ` Alan Cox
2004-11-30 13:26           ` Pavel Machek
2004-11-30 15:46             ` Al Viro
2004-11-28 12:23         ` Bernd Eckenfels

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).