man fcntl says the even the order of the fields if system specific. Padding between the fields is compiler and system specific. The size of some of these fields is system specific.

Does perl not know what this type is

Perl surely does #include <fcntl.h>, so it does know.

I guess there's no portable pure perl solution?

fcntl itself is not portable.

Aside from that, it's most definitely possible.

You're asking for a Pure Perl way of getting the structure your C compiler would created from the info the system provides in fcntl.h.

Perl (via Config) does provide the info you need to launch the C compiler using system, although Inline::C will simplify the process.

This could even be done by your installer.

You could even do this at development time. Perl (via Config) does specify which compiler and system it's running on, so you could look up the right structure at run-time.

That's a bit of a pain

That the system specifies its input as compiler-specific C code? yeah.


In reply to Re^6: fcntl failure after eval by ikegami
in thread fcntl failure after eval by flipper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.