~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to system/include/libc/sys/wait.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _SYS_WAIT_H
2
 
#define _SYS_WAIT_H
3
 
 
 
1
#ifndef _SYS_WAIT_H
 
2
#define _SYS_WAIT_H
4
3
#ifdef __cplusplus
5
4
extern "C" {
6
5
#endif
7
6
 
8
 
#include <sys/types.h>
9
 
 
10
 
#define WNOHANG 1
11
 
#define WUNTRACED 2
12
 
 
13
 
/* A status looks like:
14
 
      <2 bytes info> <2 bytes code>
15
 
 
16
 
      <code> == 0, child has exited, info is the exit value
17
 
      <code> == 1..7e, child has exited, info is the signal number.
18
 
      <code> == 7f, child has stopped, info was the signal number.
19
 
      <code> == 80, there was a core dump.
20
 
*/
21
 
   
22
 
#define WIFEXITED(w)    (((w) & 0xff) == 0)
23
 
#define WIFSIGNALED(w)  (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
24
 
#define WIFSTOPPED(w)   (((w) & 0xff) == 0x7f)
25
 
#define WEXITSTATUS(w)  (((w) >> 8) & 0xff)
26
 
#define WTERMSIG(w)     ((w) & 0x7f)
27
 
#define WSTOPSIG        WEXITSTATUS
 
7
#include <features.h>
 
8
 
 
9
#include <signal.h>
 
10
 
 
11
#define __NEED_pid_t
 
12
#define __NEED_id_t
 
13
#include <bits/alltypes.h>
 
14
 
 
15
typedef enum {
 
16
        P_ALL = 0,
 
17
        P_PID = 1,
 
18
        P_PGID = 2
 
19
} idtype_t;
28
20
 
29
21
pid_t wait (int *);
30
 
pid_t waitpid (pid_t, int *, int);
31
 
 
32
 
/* Provide prototypes for most of the _<systemcall> names that are
33
 
   provided in newlib for some compilers.  */
34
 
pid_t _wait (int *);
 
22
int waitid (idtype_t, id_t, siginfo_t *, int);
 
23
pid_t waitpid (pid_t, int *, int );
 
24
 
 
25
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 
26
#include <sys/resource.h>
 
27
pid_t wait3 (int *, int, struct rusage *);
 
28
pid_t wait4 (pid_t, int *, int, struct rusage *);
 
29
#endif
 
30
 
 
31
#define WNOHANG    1
 
32
#define WUNTRACED  2
 
33
 
 
34
#define WSTOPPED   2
 
35
#define WEXITED    4
 
36
#define WCONTINUED 8
 
37
#define WNOWAIT    0x1000000
 
38
 
 
39
#define __WNOTHREAD 0x20000000
 
40
#define __WALL      0x40000000
 
41
#define __WCLONE    0x80000000
 
42
 
 
43
#define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
 
44
#define WTERMSIG(s) ((s) & 0x7f)
 
45
#define WSTOPSIG(s) WEXITSTATUS(s)
 
46
#define WCOREDUMP(s) ((s) & 0x80)
 
47
#define WIFEXITED(s) (!WTERMSIG(s))
 
48
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
 
49
#define WIFSIGNALED(s) (((s)&0xffff)-1 < 0xffu)
 
50
#define WIFCONTINUED(s) ((s) == 0xffff)
35
51
 
36
52
#ifdef __cplusplus
37
 
};
 
53
}
38
54
#endif
39
 
 
40
55
#endif