summaryrefslogtreecommitdiff
path: root/beos/beos.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-11 15:27:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-11 15:27:06 +0000
commitefca5cc673562689e514ffff7cdd6f79da683149 (patch)
tree9977a9f8d2ac57daf4b2eccd97040b786cbd35af /beos/beos.c
parent19848b3fa09ce050a4be1811af91c3670de2759e (diff)
downloadperl-efca5cc673562689e514ffff7cdd6f79da683149.tar.gz
The BeOS waitpid() seems to be broken,
have a wrapper for it. p4raw-id: //depot/perl@13624
Diffstat (limited to 'beos/beos.c')
-rw-r--r--beos/beos.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/beos/beos.c b/beos/beos.c
new file mode 100644
index 0000000000..f0e8147109
--- /dev/null
+++ b/beos/beos.c
@@ -0,0 +1,16 @@
+#undef waitpid
+
+#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.) */
+
+pid_t beos_waitpid(pid_t process_id, int *status_location, int options) {
+ pid_t got = waitpid(procedd_is, status_location, options);
+ if (status_localtion)
+ *status_location <<= 8;
+ return got;
+}