Help:: STREAMS ioctl call failing under Solaris 7

Help:: STREAMS ioctl call failing under Solaris 7

Post by Jasim Da » Tue, 04 Jul 2000 04:00:00



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

Thanks,
Jasim
732-949-9205

 
 
 

Help:: STREAMS ioctl call failing under Solaris 7

Post by Emmanuel Dreyf » Wed, 05 Jul 2000 04:00:00



> I have code  making an ioctl call on a STREAMS device,  (/dev/ttyp0)
(snip)
> ioctl (fd, TCFLSH, 2);
(snip)
> The error generated is error no. 6  (ENXIO)

Usually, ENXIO means that there is no driver for your device file major.
But you should have got this error at open() time, not at ioctl() time.

Are you sure that that ioctl() is the failing call? Sure that ENXIO is
the error?

--
Emmanuel Dreyfus


 
 
 

Help:: STREAMS ioctl call failing under Solaris 7

Post by Andrew Gabri » Wed, 05 Jul 2000 04:00:00




Quote:>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.

TCFLSH is implemented by the ldterm module.
Have you popped that off the stream? If so and you are using telnet or
rlogin, I would not be surprised to see different behaviour as I suspect
the unhandled ioctl would end up at a stream head in 2.5.1 and at the
in-kernel telnet/rlogin processing >= 2.6, and they might handle the
unexpected ioctl differently. In any case, if ldterm has been popped,
then the TCFLSH will not actually flush anything. You can probably use
ioctl(fd, I_FLUSH, FLUSHRW) to achieve the desired effect.

--
Andrew Gabriel
Consultant Software Engineer

 
 
 

1. ioctl call fails when not on virtual terminal - help!

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
program.

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

http://www.crl.com/www/users/gh/gherlein
Vallejo, CA

2. C programmer needed

3. Stream Driver return "Timer expired" when call ioctl()

4. X11R? and solaris 2.5 ???

5. STREAMS driver: returning ioctl value, fails

6. sendmail return problems

7. The ioctl SIOCSNETOPT system call failed

8. PF_INET,SOCK_RAW - obsolete?

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

10. ioctl call fails mysteriously

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

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

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