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