If you look at man 2 fcntl, the actual Unix C function does not require a third argument. However, Fcntl::fcntl does. If you look at perldoc -f ioctl, you will find an example of fcntl using 0 as the third parameter. If you look at my original post, I have verified the validity of the syntax
$flags = fcntl( FH, F_GETFL, 0 ); $rc = fcntl( FH, F_SETFL, $flags );
However, what causes the call to fail is if I print the value returned from the F_GETFL call
$flags = fcntl( FH, F_GETFL, 0 ); print "current flags -> $flags\n"; ## now we've got trouble $rc = fcntl( FH, F_SETFL, $flags );
I am not sure why the ioctl documentation and fcntl documentation are out of synch, but the third argument is NOT required by the Unix C function; I have verified that, in the absence of the print statement, my call syntax is not the issue. Thanks for your response, feel free to correct my logic as necessary.
Victor

In reply to Re: Re: printing fcntl( fd, F_GETFL,0 ) return value changes its representation (usage) by weinstev
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.