Path: utzoo!attcan!uunet!cs.utexas.edu!news-server.csri.toronto.edu!me!eastick From: eastick@me.utoronto.ca (Doug Eastick) Newsgroups: comp.lang.perl Subject: Re: my ioctl's don't work Message-ID: <1990Apr12.094108.24785@me.toronto.edu> Date: 12 Apr 90 13:41:08 GMT References: <1990Apr11.142002.26192@me.toronto.edu> <7742@jpl-devvax.JPL.NASA.GOV> Distribution: comp Lines: 27 Copyright: none Organisation: U of Toronto, Dept. of Mechanical Engineering lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: >I wrote: >: The problem lies with the TIOCGETP ioctl: >: Can't ioctl TIOCGETP: Inappropriate ioctl for device at blah line 83. >I'd suggest you check the value of $TIOCGETP at the point of the ioctl. >If it's 0 then you may need to say $TIOCGETP = &TIOCGETP; at some point. >Likewise for $TIOCSETP. Checked it. In the debugger, "print $TIOCGETP" gives nothing (either spaces, or nulls). The $TIOCGETP = &TIOCGETP didn't help either. Any other suggestions? This seems too simple. From ioctl.h, if it helps: eval 'sub _IOR { local($x,$y,$t) = @_; eval "(&IOC_OUT|(($sizeof{$t}&&IOCPARM_MASK)<<16)|(ord(\'$x\')<<8)|$y)"; }'; eval 'sub TIOCGETP {&_IOR("t", 8,\'struct sgttyb\');}'; eval 'sub TIOCSETP {&_IOW("t", 9,\'struct sgttyb\');}'; BTW, the code came from T. Christiansen's package. His program barfs too. -- Doug Eastick -- eastick@me.utoronto.ca "I'm going to the backseat of my car with my wife, and I won't be back for TEN MINUTES!" -- Homer Simpson in Jacques to be Wild