Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with the POSIX module

After moving my mod_perl site from Linux hosting to FreeBSD, I have this error in the logfile:

Your vendor has not defined POSIX macro SIGRTMIN, used at ../../lib/POSIX.pm (autosplit into ../../lib/auto/POSIX/SigRt/_init.al) line 993\n

The script just imports POSIX and utilizes some functions (ceil, etc)

How can I solve this issue ?

like image 436
planetp Avatar asked Oct 28 '25 18:10

planetp


2 Answers

Try importing only few (or none) routines from the module:

use POSIX ();
my $n = POSIX::ceil(1.1);

This used to work for me in the same circumstances, I don't know why :)

like image 128
Eugene Yarmash Avatar answered Oct 31 '25 10:10

Eugene Yarmash


FreeBSD is mostly POSIX-compliant. For example, it doesn't define SIGRTMIN and SIGRTMAX in its signal.h. We are warned against this in POSIX's documentation:

Furthermore, some evil vendors will claim 1003.1 compliance, but in fact are not so: they will not pass the PCTS (POSIX Compliance Test Suites). For example, one vendor may not define EDEADLK, or the semantics of the errno values set by open(2) might not be quite right. Perl does not attempt to verify POSIX compliance. That means you can currently successfully say "use POSIX", and then later in your program you find that your vendor has been lax and there's no usable ICANON macro after all. This could be construed to be a bug.

eugene y's solution might work as it will prevent auto exporting into your namespace, but be sure to prefix any calls to ceil and so on with POSIX::.

like image 22
Pedro Silva Avatar answered Oct 31 '25 08:10

Pedro Silva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!