Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
rw_process.h
Go to the documentation of this file.
1
27#ifndef RW_PROCESS_H_INCLUDED
28#define RW_PROCESS_H_INCLUDED
29
30
31#include <rw_testdefs.h>
32
34
36rw_system (const char*, ...);
37
38// returns pid of the created process or -1 on error
39// (in which case errno is set to an appropriate value)
41rw_process_create (const char*, ...);
42
43// note: argv[0] should be equal to path
44// returns pid of the created process or -1 on error
45// (in which case errno is set to an appropriate value)
47rw_process_create (const char* /*path*/, char* const /*argv*/[]);
48
49// result is a pointer to a buffer where the result code
50// of the specified process will be stored, or NULL
51//
52// the function suspends execution of the current process
53// until a child has exited or specified timeout is reached
54//
55// returns:
56// pid of the specified process if it has exited
57// 0 when process still active
58// -1 on error (in which case errno is set to an appropriate value)
59//
60// timeout is timeout interval in seconds.
61// if timeout > 0 the function returns if the interval elapses
62// if timeout == 0 the function returns immediately
63// if timeout < 0 the function's time-out interval never elapses
64//
65// errors:
66// ECHILD: no specified process exists
68rw_waitpid (rw_pid_t /*pid*/, int* /*result*/, int /*timeout*/ = -1);
69
70// returns:
71// 0 when process terminated successfully
72// 1 when signal was sent to the child process, but child process
73// not terminated within 1 second interval
74// -1 on error (in which case errno is set to an appropriate value)
75// errors:
76// ESRCH: the pid does not exist
77// EPERM: the calling process does not have permission
78// to terminate the specified process
80rw_process_kill (rw_pid_t, int = -1);
81
82#endif // RW_PROCESS_H_INCLUDED
#define _RWSTD_SSIZE_T
Definition _defs.h:1280
_RWSTD_SSIZE_T rw_pid_t
Definition rw_process.h:33
_TEST_EXPORT rw_pid_t rw_process_create(const char *,...)
Definition process.cpp:395
_TEST_EXPORT rw_pid_t rw_waitpid(rw_pid_t, int *, int=-1)
Definition process.cpp:533
_TEST_EXPORT int rw_system(const char *,...)
Definition process.cpp:328
_TEST_EXPORT int rw_process_kill(rw_pid_t, int=-1)
Definition process.cpp:663
#define _TEST_EXPORT
Definition rw_testdefs.h:55