ioctl call fails when not on virtual terminal - help!

ioctl call fails when not on virtual terminal - help!

Post by Greg Herle » Tue, 25 Feb 1997 04:00:00

I've got a program that makes some ioctl calls to the serial driver to
check the line status register.

This program runs *FINE* if run while logged in on a virtual terminal.
Yes, I'm logged on as root when I run it.

This program fails if run from a shell via telnet.  Specifically, the
icotl call returns -1 and errno is "I/O Error" - ie, the call to check
the LSR fails.  I log in remotely as myself then su to root to run the

This program fails the same way if it is started on boot from rc.local.

The only way I can successfully run the program is to log on to a
local virtual terminal and run it.  Considering this is a remote
gateway application machine that has to run on a mountain (away from
humans) this is not acceptable.

I'm suspecting this has something to do with the controlling terminal,
but I'm not sure.  But *why*???  I can't see how they are related, but
they evidently are.

Anyone have a clue?  Help would be most appreciated!!!

OBTW:  system is linux 2.0.23

Greg Herlein
Vallejo, CA


ioctl call fails when not on virtual terminal - help!

Post by B.A.McCau.. » Mon, 03 Mar 1997 04:00:00

[ A very interesting problem ]

Quote:>Anyone have a clue?

I was fascinated by your problem and thought "this is interesting I'll
look into this".  Then I noticed that you hadn't included a mechanism
to reproduce the bug.

Please always always always include a short program to reproduce your

Most of the time it turns out people have made a simple mistake that
is spotted immediately when they post the code.  (Althoug this seems
unlikely in this case).

The rest of the time the code helps other people figure out what is
going on.

Prose without a hard example will rearely bring you joy and will leave
people like me looking for a meaty chalenge in these newsgroups just
feeling frustrated.


 .  _\\__[oo       from       | Phones: +44 121 471 3789 (home)

.  l___\\    /~~) /~~[  /   [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
 # ll  l\\  ~~~~ ~   ~ ~    ~ |


1. Help:: STREAMS ioctl call failing under Solaris 7

I have code  making an ioctl call on a STREAMS device,  (/dev/ttyp0) to
flush the io buffers.

ioctl (fd, TCFLSH, 2);

It works fine on Solaris 2.5.1  !!

But does not work under Solaris 2.7 ( Solaris 7) even after a recompile.
I am using the 32 bit  kernel of Solaris.
The error generated is error no. 6  (ENXIO)

Any input  would be very useful


2. Diskless Net boot error message

3. The ioctl SIOCSNETOPT system call failed

4. How do I tell if it is postscript file

5. ioctl SIOCGIFCONF fails when there are >32 virtual interfaces

6. banner print page

7. ioctl call - SIOCGIFCONF from a i386 fails on ia64

8. CGI access on a particular file?

9. ioctl call fails mysteriously

10. Can an ioctl call fail even before reaching the device/driver?

11. Failed Terminal ioctl's

12. getting 'ioctl failed: Inappropriate ioctl for device'

13. getting - "ioctl failed: Inappropriate ioctl for device"