# include <vm/vm_param.h>
#endif
-#ifndef newCONSTSUB
-static void
-newCONSTSUB(stash,name,sv)
- HV *stash;
- char *name;
- SV *sv;
-{
-#ifdef dTHR
- dTHR;
-#endif
- U32 oldhints = hints;
- HV *old_cop_stash = curcop->cop_stash;
- HV *old_curstash = curstash;
- line_t oldline = curcop->cop_line;
- curcop->cop_line = copline;
-
- hints &= ~HINT_BLOCK_SCOPE;
- if(stash)
- curstash = curcop->cop_stash = stash;
-
- newSUB(
- start_subparse(FALSE, 0),
- newSVOP(OP_CONST, 0, newSVpv(name,0)),
- newSVOP(OP_CONST, 0, &sv_no), /* SvPV(&sv_no) == "" -- GMB */
- newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
- );
-
- hints = oldhints;
- curcop->cop_stash = old_cop_stash;
- curstash = old_curstash;
- curcop->cop_line = oldline;
-}
-#endif
-
MODULE=IPC::SysV PACKAGE=IPC::Msg::stat
PROTOTYPES: ENABLE
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
CODE:
#if defined(HAS_SEM) || defined(HAS_SHM)
key_t k = ftok(path, id);
- ST(0) = k == (key_t) -1 ? &sv_undef : sv_2mortal(newSViv(k));
+ ST(0) = k == (key_t) -1 ? &PL_sv_undef : sv_2mortal(newSViv(k));
#else
DIE(no_func, "ftok");
#endif