in reply to How to get 'Fcntl' defines on Strawberry Perl?
When I run the following code:
perl -wle "use Fcntl;$n=O_CREAT | O_NONBLOCK | O_RDWR;print $n;"
I get
Your vendor has not defined Fcntl macro O_NONBLOCK, used at -e line 1.
... which is highly likely true, because nonblocking file IO does not exist on Windows, and thus a constant O_NONBLOCK does not exist on Windows. Using the numerical values that are defined on Linux will likely not work for other operating systems because the vendors may (or may not) have defined different values for the symbolic names.
I recommend that you evaluate your program whether O_NONBLOCK is actually needed. If that feature is acutally needed, you will need to investigate what to do on operating systems where O_NONBLOCK does not exist. If you don't need it, just remove it.
If this is to be used for sockets (and not generic files), you will need to look up the way to switch a socket to nonblocking IO on Windows. It is some IOCtl that is usually found via Google.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to get 'Fcntl' defines on Strawberry Perl?
by flexvault (Monsignor) on Feb 08, 2012 at 14:06 UTC |