/* $Id: $ */
/** @file
 * EMX
 */

#ifndef _SYS_PROCESS_H
#define _SYS_PROCESS_H

#include <sys/cdefs.h>
#include <sys/_types.h>

__BEGIN_DECLS

#if !defined(_PID_T_DECLARED) && !defined(_PID_T)
typedef	__pid_t pid_t;
#define	_PID_T_DECLARED
#define _PID_T
#endif

#if !defined (P_WAIT)
#define P_WAIT    0
#define P_NOWAIT  1
#define P_OVERLAY 2
#define P_DEBUG   3
#define P_SESSION 4
#define P_DETACH  5
#define P_PM      6

#define P_DEFAULT    0x0000
#define P_MINIMIZE   0x0100
#define P_MAXIMIZE   0x0200
#define P_FULLSCREEN 0x0300
#define P_WINDOWED   0x0400

#define P_FOREGROUND 0x0000
#define P_BACKGROUND 0x1000

#define P_NOCLOSE    0x2000
#define P_NOSESSION  0x4000

#define P_QUOTE      0x10000
#define P_TILDE      0x20000
#define P_UNRELATED  0x40000
#define P_DEBUGDESC  0x80000

#endif

void abort (void)  __attribute__ ((__noreturn__));
int atexit (void (*)(void));
int execl (__const__ char *, __const__ char *, ...);
int execle (__const__ char *, __const__ char *, ...);
int execlp (__const__ char *, __const__ char *, ...);
int execlpe (__const__ char *, __const__ char *, ...);
int execv (__const__ char *, char * __const__ *);
int execve (__const__ char *, char * __const__ *, char * __const__ *);
int execvp (__const__ char *, char * __const__ *);
int execvpe (__const__ char *, char * __const__ *, char * __const__ *);
void exit (int) __attribute__ ((__noreturn__));
void _exit (int) __attribute__ ((__noreturn__));
pid_t fork (void);
pid_t getpid (void);
pid_t getppid (void);
int spawnl (int, __const__ char *, __const__ char *, ...);
int spawnle (int, __const__ char *, __const__ char *, ...);
int spawnlp (int, __const__ char *, __const__ char *, ...);
int spawnlpe (int, __const__ char *, __const__ char *, ...);
int spawnv (int, __const__ char *, char * __const__ *);
int spawnve (int, __const__ char *, char * __const__ *, char * __const__ *);
int spawnvp (int, __const__ char *, char * __const__ *);
int spawnvpe (int, __const__ char *, char * __const__ *, char * __const__ *);
int system (__const__ char *);
pid_t wait (int *);
pid_t waitpid (pid_t, int *, int);

int _execl (__const__ char *, __const__ char *, ...);
int _execle (__const__ char *, __const__ char *, ...);
int _execlp (__const__ char *, __const__ char *, ...);
int _execlpe (__const__ char *, __const__ char *, ...);
int _execv (__const__ char *, char * __const__ *);
int _execve (__const__ char *, char * __const__ *, char * __const__ *);
int _execvp (__const__ char *, char * __const__ *);
int _execvpe (__const__ char *, char * __const__ *, char * __const__ *);
int _fork (void);
pid_t _getpid (void);
pid_t _getppid (void);
int _spawnl (int, __const__ char *, __const__ char *, ...);
int _spawnle (int, __const__ char *, __const__ char *, ...);
int _spawnlp (int, __const__ char *, __const__ char *, ...);
int _spawnlpe (int, __const__ char *, __const__ char *, ...);
int _spawnv (int, __const__ char *, char * __const__ *);
int _spawnve (int, __const__ char *, char * __const__ *, char * __const__ *);
int _spawnvp (int, __const__ char *, char * __const__ *);
int _spawnvpe (int, __const__ char *, char * __const__ *, char * __const__ *);
pid_t _wait (int *);
pid_t _waitpid (pid_t, int *, int);

__END_DECLS

#endif /* not _SYS_PROCESS_H */
