summaryrefslogtreecommitdiff
path: root/beos/beos.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-26 19:52:03 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-26 19:52:03 +0000
commitdff18f87b95b47b2b3dc9fa1769bd282a2d85916 (patch)
tree1a2cb8edb4767001ed99d7ad74dee908e74e33c7 /beos/beos.c
parent04a0f00b3d99a470b527ee741b302cef993c2cc4 (diff)
downloadperl-dff18f87b95b47b2b3dc9fa1769bd282a2d85916.tar.gz
BeOS updates.
p4raw-id: //depot/perl@13895
Diffstat (limited to 'beos/beos.c')
-rw-r--r--beos/beos.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/beos/beos.c b/beos/beos.c
index d5f7fbab48..7e799caf54 100644
--- a/beos/beos.c
+++ b/beos/beos.c
@@ -5,14 +5,16 @@
#include <sys/wait.h>
/* In BeOS 5.0 the waitpid() seems to misbehave in that the status
- * is _not_ shifted left by eight (multiplied by 256), as it is in
- * POSIX/UNIX. To undo the surpise effect to the rest of Perl we
- * need this wrapper. (The rest of BeOS might be surprised because
- * of this, though.) */
+ * has the upper and lower bytes swapped compared with the usual
+ * POSIX/UNIX implementations. To undo the surpise effect to the
+ * rest of Perl we need this wrapper. (The rest of BeOS might be
+ * surprised because of this, though.) */
pid_t beos_waitpid(pid_t process_id, int *status_location, int options) {
pid_t got = waitpid(process_id, status_location, options);
if (status_location)
- *status_location <<= 8; /* What about the POSIX low bits? */
+ *status_location =
+ (*status_location & 0x00FF) << 8 |
+ (*status_location & 0xFF00) >> 8;
return got;
}