williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
/**
|
williamr@2
|
21 |
@file
|
williamr@2
|
22 |
@publishedAll
|
williamr@2
|
23 |
@released
|
williamr@2
|
24 |
*/
|
williamr@2
|
25 |
|
williamr@2
|
26 |
#ifndef _SYS_WAIT_H
|
williamr@2
|
27 |
#define _SYS_WAIT_H
|
williamr@2
|
28 |
|
williamr@2
|
29 |
#ifdef __cplusplus
|
williamr@2
|
30 |
extern "C" {
|
williamr@2
|
31 |
#endif
|
williamr@2
|
32 |
#include <_ansi.h>
|
williamr@2
|
33 |
#include <sys/types.h>
|
williamr@2
|
34 |
|
williamr@2
|
35 |
#define WNOHANG 1
|
williamr@2
|
36 |
#define WUNTRACED 2
|
williamr@2
|
37 |
|
williamr@2
|
38 |
/**
|
williamr@2
|
39 |
A status looks like:
|
williamr@2
|
40 |
<2 bytes info> <2 bytes code>
|
williamr@2
|
41 |
|
williamr@2
|
42 |
<code> == 0, child has exited, info is the exit value
|
williamr@2
|
43 |
<code> == 1..7e, child has exited, info is the signal number.
|
williamr@2
|
44 |
<code> == 7f, child has stopped, info was the signal number.
|
williamr@2
|
45 |
<code> == 80, there was a core dump.
|
williamr@2
|
46 |
<code/>
|
williamr@2
|
47 |
*/
|
williamr@2
|
48 |
#define WIFEXITED(w) (((w) & 0xff) == 0)
|
williamr@2
|
49 |
#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && ((w) & 0x7f< 0x7f))
|
williamr@2
|
50 |
#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f)
|
williamr@2
|
51 |
#define WEXITSTATUS(w) (((w) >> 8) & 0xff)
|
williamr@2
|
52 |
#define WTERMSIG(w) ((w) & 0x7f)
|
williamr@2
|
53 |
#define WSTOPSIG WEXITSTATUS
|
williamr@2
|
54 |
#define WAIT_ANY (-1)
|
williamr@2
|
55 |
|
williamr@2
|
56 |
IMPORT_C pid_t wait (int* status);
|
williamr@2
|
57 |
IMPORT_C pid_t waitpid (pid_t pid, int* status, int options);
|
williamr@2
|
58 |
|
williamr@2
|
59 |
|
williamr@2
|
60 |
#ifdef __cplusplus
|
williamr@2
|
61 |
}
|
williamr@2
|
62 |
#endif
|
williamr@2
|
63 |
|
williamr@2
|
64 |
#endif
|