return pp_ftrread();
}
+PP(pp_msgsnd)
+{
+ return pp_shmwrite();
+}
+
+PP(pp_msgrcv)
+{
+ return pp_shmwrite();
+}
+
U8 *
Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv)
{
MEMBER_TO_FPTR(Perl_pp_shmwrite),
MEMBER_TO_FPTR(Perl_pp_semget), /* Perl_pp_msgget */
MEMBER_TO_FPTR(Perl_pp_semctl), /* Perl_pp_msgctl */
- MEMBER_TO_FPTR(Perl_pp_msgsnd),
- MEMBER_TO_FPTR(Perl_pp_msgrcv),
+ MEMBER_TO_FPTR(Perl_pp_shmwrite), /* Perl_pp_msgsnd */
+ MEMBER_TO_FPTR(Perl_pp_shmwrite), /* Perl_pp_msgrcv */
MEMBER_TO_FPTR(Perl_pp_semget),
MEMBER_TO_FPTR(Perl_pp_semctl),
MEMBER_TO_FPTR(Perl_pp_semop),
Perl_pp_link => ['symlink'],
Perl_pp_ftrread => [qw(ftrwrite ftrexec fteread ftewrite
fteexec)],
+ Perl_pp_shmwrite => [qw(msgsnd msgrcv)],
);
while (my ($func, $names) = splice @raw_alias, 0, 2) {
}
/* Shared memory. */
+/* Merged with some message passing. */
PP(pp_shmwrite)
{
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
dSP; dMARK; dTARGET;
- I32 value = (I32)(do_shmio(PL_op->op_type, MARK, SP) >= 0);
- SP = MARK;
- PUSHi(value);
- RETURN;
-#else
- return pp_semget();
-#endif
-}
-
-/* Message passing. */
+ const int op_type = PL_op->op_type;
+ I32 value;
-PP(pp_msgsnd)
-{
-#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
- dSP; dMARK; dTARGET;
- I32 value = (I32)(do_msgsnd(MARK, SP) >= 0);
- SP = MARK;
- PUSHi(value);
- RETURN;
-#else
- return pp_semget();
-#endif
-}
+ switch (op_type) {
+ case OP_MSGSND:
+ value = (I32)(do_msgsnd(MARK, SP) >= 0);
+ break;
+ case OP_MSGRCV:
+ value = (I32)(do_msgrcv(MARK, SP) >= 0);
+ break;
+ default:
+ value = (I32)(do_shmio(op_type, MARK, SP) >= 0);
+ break;
+ }
-PP(pp_msgrcv)
-{
-#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
- dSP; dMARK; dTARGET;
- I32 value = (I32)(do_msgrcv(MARK, SP) >= 0);
SP = MARK;
PUSHi(value);
RETURN;