I never said your syntax was incorrect. You should not be passing 0 as the third argument for F_GETFL.

Update: isotope mentioned to me that newer versions of the ioctl POD do exactly as you have done. Well, I get suspicious of an examples in ioclt POD that are for the wrong function, and it didn't look like anyone was trying what I suggested. So I tried the different methods of doing F_GETFL (one from fcntl, one from ioctl) on an ancient Unix system that was handy and the one from ioctl was correct (on that Unix system), but it also didn't exhibit the original problems in this thread. So I suspect that the usage of F_GETFL varies between versions of Unix.

In any case, one or both of the fcntl/ioctl PODs could use some updates when we figure this out. (:

                - tye

In reply to Re^3: printing fcntl( fd, F_GETFL,0 ) return value changes its representation (usage) by tye
in thread printing fcntl( fd, F_GETFL,0 ) return value changes its representation by weinstev

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.