1752546 Members
5091 Online
108788 Solutions
New Discussion юеВ

perl 5.6.1 and ioctl

 
Keith Curnow
Occasional Contributor

perl 5.6.1 and ioctl

Has anyone gotten ioctl to work?
I have tried many variants to compiling perl5.6.1 to get ioctl to work and none work.

I've even downloaded it from http://hpux.connect.org.uk/hppd/hpux/Languages/perl-5.6.1

It doesn't work seem to work.
I've run "h2ph -r -l *" to get the *.ph files that I need.

What am I missing? Or what compile options do I need to get this to work.

BTW, I had the same problem on perl 5.5003.


Thanks in advance,
--Keith
2 REPLIES 2
Eugen Cocalea
Respected Contributor

Re: perl 5.6.1 and ioctl

Hi,

See the link:

http://www-2.cs.cmu.edu/People/rgs/pl-exp-io.html

What exactly is the problem? What are you trying to do and it's not working?

E.
To Live Is To Learn
Keith Curnow
Occasional Contributor

Re: perl 5.6.1 and ioctl

I am just trying some basic ioctl's.
I have even tried the example of ioctl that I've found documented.

I
Here is the code:
********************************
require 'sys/ioctl.ph';
$sgttyb_t = "ccccs"; #4 chars and a short
$rc=ioctl(STDIN,$TIOCGETP,$sgttyb);

print "RC=>>$rc<<\n";
print "System=>>$!<<\n\n";

if ($rc)
{
@ary = unpack($sgttyb_t,$sgttyb);
$ary[2] = 127;
$sgttyb = pack($sgttyb_t,@ary);
ioctl(STDIN,$TIOCSETP,$sgttyb)
|| die "Can't ioctl: $!";
}
********************************
Here is the output:
********************************
RC=>><<
System=>>Invalid argument<<