libposix: drafted Child structure
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
extern int *__libposix_errors_codes;
|
extern int *__libposix_errors_codes;
|
||||||
extern WaitList **__libposix_wait_list;
|
extern WaitList **__libposix_wait_list;
|
||||||
|
extern Child **__libposix_child_list;
|
||||||
static int __initialized;
|
static int __initialized;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -43,6 +44,7 @@ libposix_init(int argc, char *argv[], PosixInit init)
|
|||||||
extern int *__libposix_sigchld_target_pid;
|
extern int *__libposix_sigchld_target_pid;
|
||||||
|
|
||||||
WaitList *wait_list;
|
WaitList *wait_list;
|
||||||
|
Child *child_list;
|
||||||
int status;
|
int status;
|
||||||
int error_codes[ERRNO_LAST-ERRNO_FIRST];
|
int error_codes[ERRNO_LAST-ERRNO_FIRST];
|
||||||
unsigned char signals_to_code[256];
|
unsigned char signals_to_code[256];
|
||||||
@@ -60,6 +62,10 @@ libposix_init(int argc, char *argv[], PosixInit init)
|
|||||||
wait_list = nil;
|
wait_list = nil;
|
||||||
__libposix_wait_list = &wait_list;
|
__libposix_wait_list = &wait_list;
|
||||||
|
|
||||||
|
/* initialize child_list; used when SIGCHLD is enabled */
|
||||||
|
child_list = nil;
|
||||||
|
__libposix_wait_list = &child_list;
|
||||||
|
|
||||||
/* initialize signal handling */
|
/* initialize signal handling */
|
||||||
memset(signals_to_code, 0, sizeof(signals_to_code));
|
memset(signals_to_code, 0, sizeof(signals_to_code));
|
||||||
memset(code_to_signal, 0, sizeof(code_to_signal));
|
memset(code_to_signal, 0, sizeof(code_to_signal));
|
||||||
|
@@ -23,6 +23,13 @@ struct WaitList
|
|||||||
WaitList *next;
|
WaitList *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct Child Child;
|
||||||
|
struct Child
|
||||||
|
{
|
||||||
|
int pid;
|
||||||
|
Child *next;
|
||||||
|
};
|
||||||
|
|
||||||
extern void __libposix_files_check_conf(void);
|
extern void __libposix_files_check_conf(void);
|
||||||
extern void __libposix_errors_check_conf(void);
|
extern void __libposix_errors_check_conf(void);
|
||||||
extern void __libposix_processes_check_conf(void);
|
extern void __libposix_processes_check_conf(void);
|
||||||
|
@@ -23,6 +23,8 @@
|
|||||||
extern char **environ;
|
extern char **environ;
|
||||||
|
|
||||||
WaitList **__libposix_wait_list;
|
WaitList **__libposix_wait_list;
|
||||||
|
Child **__libposix_child_list;
|
||||||
|
|
||||||
static PosixExitStatusTranslator __libposix_exit_status_translator;
|
static PosixExitStatusTranslator __libposix_exit_status_translator;
|
||||||
static int __libposix_wnohang;
|
static int __libposix_wnohang;
|
||||||
|
|
||||||
@@ -45,6 +47,7 @@ __libposix_setup_new_process(void)
|
|||||||
{
|
{
|
||||||
/* reset wait list for the child */
|
/* reset wait list for the child */
|
||||||
*__libposix_wait_list = nil;
|
*__libposix_wait_list = nil;
|
||||||
|
*__libposix_child_list = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
/* rendezvous points */
|
/* rendezvous points */
|
||||||
extern unsigned char *__signals_to_code_map;
|
extern unsigned char *__signals_to_code_map;
|
||||||
extern unsigned char *__code_to_signal_map;
|
extern unsigned char *__code_to_signal_map;
|
||||||
|
extern Child *__libposix_child_list;
|
||||||
|
|
||||||
/* pointer to the pid to forward notes to */
|
/* pointer to the pid to forward notes to */
|
||||||
int *__libposix_sigchld_target_pid;
|
int *__libposix_sigchld_target_pid;
|
||||||
|
Reference in New Issue
Block a user