You are not logged in.

#1 2015-07-07 08:54:21

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 195

[SOLVED] Perl header file "sys/ioctl.ph"

I have a snippet of Perl code that includes the line:

require "sys/ioctl.ph

This doesn't appear to be recognised by perl on Arch. Is this an omission, is the snippet wrong, or is there a package that I need to install ?

I've googled and seen other mentions of this header and it being missing. I've don't think I've missed an Arch package.

Perl isn't everyday for me - perpaps someone for whom it is would know the answer to this?

Many thanks.

Last edited by starfry (2015-07-08 09:53:30)

Offline

#2 2015-07-07 15:54:07

teckk
Member
Registered: 2013-02-21
Posts: 316

Re: [SOLVED] Perl header file "sys/ioctl.ph"

/usr/include/linux/ioctl.h
http://stackoverflow.com/questions/1203 … rl-headers

Post the code. I'm sure that someone can answer.

Offline

#3 2015-07-08 09:53:15

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 195

Re: [SOLVED] Perl header file "sys/ioctl.ph"

The code I was playing with is this:

perl -e 'require "sys/ioctl.ph"; ioctl(STDIN, &TIOCSTI, $_) for split "", join " ", @ARGV' echo test

I get this

Can't locate sys/ioctl.ph in @INC (did you run h2ph?) (@INC contains: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at -e line 1.

It works if I work around the issue

perl -e 'ioctl(STDIN, 0x5412, $_) for split "", join " ", @ARGV' echo test

Since posting the question, I looked into it a bit more and found "h2ph" (thanks to the prompt in the error message wink). I read this and went ahead and did this:

(cd /usr/include; sudo h2ph -r -l .)

After that, my original command worked. However, I think "h2ph" run like that may generate a load of unwanted perl header files. It probably doesn't matter but a little more thought might be appropriate.

Offline

Board footer

Powered by FluxBB