diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1998-07-31 16:13:57 +0300 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-08-02 04:39:14 +0000 |
commit | 6087ac4414f58a8f56f41d3b670cd75f7a5e6936 (patch) | |
tree | 7462efad1880ee60b5108353620202d8ef691e4b /ext/IPC/SysV | |
parent | ed0d1bf7a96441c0ced673e08553f37b3d8b5613 (diff) | |
download | perl-6087ac4414f58a8f56f41d3b670cd75f7a5e6936.tar.gz |
better validation of SysV IPC availability
Message-Id: <199807311013.NAA28887@koah.research.nokia.com>
Subject: Re: lib/ipc_sysv.t fails under FreeBSD 2.2.1
p4raw-id: //depot/maint-5.005/perl@1692
Diffstat (limited to 'ext/IPC/SysV')
-rw-r--r-- | ext/IPC/SysV/SysV.xs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/IPC/SysV/SysV.xs b/ext/IPC/SysV/SysV.xs index 3503ad92b1..818c751ff2 100644 --- a/ext/IPC/SysV/SysV.xs +++ b/ext/IPC/SysV/SysV.xs @@ -41,6 +41,7 @@ pack(obj) SV * obj PPCODE: { +#ifdef HAS_MSG SV *sv; struct msqid_ds ds; AV *list = (AV*)SvRV(obj); @@ -50,6 +51,9 @@ PPCODE: 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 @@ -58,6 +62,7 @@ unpack(obj,buf) SV * buf PPCODE: { +#ifdef HAS_MSG STRLEN len; SV **sv_ptr; struct msqid_ds *ds = (struct msqid_ds *)SvPV(buf,len); @@ -92,6 +97,9 @@ PPCODE: 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 @@ -102,6 +110,7 @@ unpack(obj,ds) SV * ds PPCODE: { +#ifdef HAS_SEM STRLEN len; AV *list = (AV*)SvRV(obj); struct semid_ds *data = (struct semid_ds *)SvPV(ds,len); @@ -122,6 +131,9 @@ PPCODE: 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 @@ -129,6 +141,7 @@ pack(obj) SV * obj PPCODE: { +#ifdef HAS_SEM SV **sv_ptr; SV *sv; struct semid_ds ds; @@ -154,6 +167,9 @@ PPCODE: 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 |