nivlek78 has asked for the wisdom of the Perl Monks concerning the following question:

###### I/O unblocking ###### fcntl($sock, F_GETFL,$flags) or die "Cannot get flags for socket : $!\n"; $flags |= O_NONBLOCK; fcntl($sock,F_SETFL,$flags) or die "Cannot set flags for socket : $!\n";
I keep getting this error "Your vendor has not defined Fcntl macro F_GETFL"
what does that mean???
sorry if this is a noob question rather new to perl

Replies are listed 'Best First'.
Re: problem with fcntl
by dug (Chaplain) on Oct 11, 2002 at 16:31 UTC
    From perldoc -f fcntl:
    Note that "fcntl" will produce a fatal error if used on a
    machine that doesn’t implement fcntl(2).  See the Fcntl 
    module or your fcntl(2) manpage to learn what functions 
    are available on your system.
    

    Recent versions of Perl directly translate your systems' fcntl.h file and define what it defines. My fcntl.h file includes bits/fcntl.h to get the definitions of O_*, FD_* and F_*, including F_GETFL and F_SETFL. My perl intallation recognized this and defined them for me in Fcntl.pm.

    What OS are you running?

    -- dug
      I am running windows with the lastest version of activestate perl
      does this mean that fcntl(2) is not implemented on windows?
        Which Windows? I don't have access to a Windows evironment and probably won't be able to help much, but reply with the output of perl -V, as well as something more specific than "windows" and maybe some of the other kind folks here can help you out.

        -- dug