ioctl problem in A/UX 2.0

Richard Todd rmtodd at servalan.uucp
Sat Mar 9 12:38:39 AEST 1991


pke at public.BTR.COM (Peter Espen  pke at btr.com) writes:
>Can someone explain to me why the first ioctl call in the following test
>program fails with an invalid argument error? 

Afraid not.  It gets past that ioctl with no problems for me.  

>I am running A/UX 2.0.

So am I.  I don't know offhand why that ioctl should fail, unless somehow
the char. special file "/dev/tty0" has gotten its major/minor numbers munged.
(They're 0,0 on my system; I think they should be the same on all A/UX systems,
though I'm not sure on this).  

While I'm here, however, I might as well point out one thing I noticed about
your program, namely that it did segfault later on when I ran it,
right at the fputs() :

>	if ((fp = open( name, O_RDWR | O_NDELAY)) == NULL) {
>...
>	if (fputs(buf, fp) == NULL)

open returns a file descriptor, and fputs, expecting a FILE pointer, gets 
rather out of sorts at being passed a file descriptor instead.  
--
Richard Todd	rmtodd at uokmax.ecn.uoknor.edu  rmtodd at chinet.chi.il.us
	rmtodd at servalan.uucp
"Try looking in the Yellow Pages under 'Psychotics'." -- Michael Santana



More information about the Comp.unix.aux mailing list