ca562039ca9a90c3779bf7be563a5fc2f5a68786
[p5sagit/p5-mst-13.2.git] / beos / beos.c
1 #include "beosish.h"
2
3 #undef waitpid
4
5 #include <sys/wait.h>
6
7 /* In BeOS 5.0 the waitpid() seems to misbehave in that the status
8  * is _not_ shifted left by eight (multiplied by 256), as it is in
9  * POSIX/UNIX.  To undo the surpise effect to the rest of Perl we
10  * need this wrapper.  (The rest of BeOS might be surprised because
11  * of this, though.) */
12
13 pid_t beos_waitpid(pid_t process_id, int *status_location, int options) {
14     pid_t got = waitpid(process_id, status_location, options);
15     if (status_location)
16       *status_location <<= 8; /* What about the POSIX low bits? */
17     return got;
18 }