case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
*"$undef"*) h_msg=false;;
esac
+case "$osname" in
+freebsd)
+ case "`ipcs 2>&1`" in
+ "SVID messages"*"not configured"*)
+ echo "But your FreeBSD kernel does not have the msg*(2) configured." >&4
+ h_msg=false
+ val="$undef"
+ set msgctl d_msgctl
+ eval $setvar
+ set msgget d_msgget
+ eval $setvar
+ set msgsnd d_msgsnd
+ eval $setvar
+ set msgrcv d_msgrcv
+ eval $setvar
+ ;;
+ esac
+ ;;
+esac
: we could also check for sys/ipc.h ...
if $h_msg && $test `./findhdr sys/msg.h`; then
echo "You have the full msg*(2) library." >&4
case "$d_semctl$d_semget$d_semop" in
*"$undef"*) h_sem=false;;
esac
+case "$osname" in
+freebsd)
+ case "`ipcs 2>&1`" in
+ "SVID messages"*"not configured"*)
+ echo "But your FreeBSD kernel does not have the sem*(2) configured." >&4
+ h_sem=false
+ val="$undef"
+ set semctl d_semctl
+ eval $setvar
+ set semget d_semget
+ eval $setvar
+ set semop d_semop
+ eval $setvar
+ ;;
+ esac
+ ;;
+esac
: we could also check for sys/ipc.h ...
if $h_sem && $test `./findhdr sys/sem.h`; then
echo "You have the full sem*(2) library." >&4
case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
*"$undef"*) h_shm=false;;
esac
+case "$osname" in
+freebsd)
+ case "`ipcs 2>&1`" in
+ "SVID shared memory"*"not configured"*)
+ echo "But your FreeBSD kernel does not have the shm*(2) configured." >&4
+ h_shm=false
+ val="$undef"
+ set shmctl d_shmctl
+ evat $setvar
+ set shmget d_shmget
+ evat $setvar
+ set shmat d_shmat
+ evat $setvar
+ set shmdt d_shmdt
+ evat $setvar
+ ;;
+ esac
+ ;;
+esac
: we could also check for sys/ipc.h ...
if $h_shm && $test `./findhdr sys/shm.h`; then
echo "You have the full shm*(2) library." >&4
with FreeBSD 2.1) had broken handling of recno databases with modified
bval settings. Upgrade your DB library or OS.
+=item Bad arg length for semctl, is XX, should be ZZZ
+
+If you get this error message from the lib/ipc_sysv test, your System
+V IPC may be broken. The XX typically is 20, and that is what ZZZ
+also should be. Consider upgrading your OS, or reconfiguring your OS
+to include the System V semaphores.
+
=item Miscellaneous
Some additional things that have been reported for either perl4 or perl5:
UTS may need one or more of -DCRIPPLED_CC, -K or -g, and undef LSTAT.
+FreeBSD will fail the lib/ipc_sysv.t test if SysV IPC has not been
+configured to the kernel.
+
If you get syntax errors on '(', try -DCRIPPLED_CC.
Machines with half-implemented dbm routines will need to #undef I_ODBM
SV * obj
PPCODE:
{
+#ifdef HAS_MSG
SV *sv;
struct msqid_ds ds;
AV *list = (AV*)SvRV(obj);
sv = *av_fetch(list,6,TRUE); ds.msg_qbytes = SvIV(sv);
ST(0) = sv_2mortal(newSVpv((char *)&ds,sizeof(ds)));
XSRETURN(1);
+#else
+ croak("System V msgxxx is not implemented on this machine");
+#endif
}
void
SV * buf
PPCODE:
{
+#ifdef HAS_MSG
STRLEN len;
SV **sv_ptr;
struct msqid_ds *ds = (struct msqid_ds *)SvPV(buf,len);
sv_ptr = av_fetch(list,11,TRUE);
sv_setiv(*sv_ptr, ds->msg_ctime);
XSRETURN(1);
+#else
+ croak("System V msgxxx is not implemented on this machine");
+#endif
}
MODULE=IPC::SysV PACKAGE=IPC::Semaphore::stat
SV * ds
PPCODE:
{
+#ifdef HAS_SEM
STRLEN len;
AV *list = (AV*)SvRV(obj);
struct semid_ds *data = (struct semid_ds *)SvPV(ds,len);
sv_setiv(*av_fetch(list,6,TRUE), data[0].sem_otime);
sv_setiv(*av_fetch(list,7,TRUE), data[0].sem_nsems);
XSRETURN(1);
+#else
+ croak("System V semxxx is not implemented on this machine");
+#endif
}
void
SV * obj
PPCODE:
{
+#ifdef HAS_SEM
SV **sv_ptr;
SV *sv;
struct semid_ds ds;
ds.sem_nsems = SvIV(*sv_ptr);
ST(0) = sv_2mortal(newSVpv((char *)&ds,sizeof(ds)));
XSRETURN(1);
+#else
+ croak("System V semxxx is not implemented on this machine");
+#endif
}
MODULE=IPC::SysV PACKAGE=IPC::SysV
instead of Perl. Check the #! line, or manually feed your script
into Perl yourself.
-=item System V IPC is not implemented on this machine
+=item System V %s is not implemented on this machine
-(F) You tried to do something with a function beginning with "sem", "shm",
-or "msg". See L<perlfunc/semctl>, for example.
+(F) You tried to do something with a function beginning with "sem",
+"shm", or "msg" but that System V IPC is not implemented in your
+machine. In some machines the functionality can exist but be
+unconfigured. Consult your system support.
=item Syswrite on closed filehandle
$SIG{__DIE__} = 'cleanup'; # will cleanup $msg and $sem if needed
+# FreeBSD is known to throw this if there's no SysV IPC in the kernel.
+$SIG{SYS} = sub {
+ print STDERR <<EOM;
+SIGSYS caught.
+It may be that your kernel does not have SysV IPC configured.
+
+EOM
+ if ($^O eq 'freebsd') {
+ print STDERR <<EOM;
+You must have following options in your kernel:
+
+options SYSVSHM
+options SYSVSEM
+options SYSVMSG
+
+See config(8).
+EOM
+ }
+ exit(1);
+};
+
if ($Config{'d_msgget'} eq 'define' &&
$Config{'d_msgctl'} eq 'define' &&
$Config{'d_msgsnd'} eq 'define' &&