processes.c header.
More...
#include "../misc/ipc.h"
#include <sys/types.h>
Go to the source code of this file.
|
| void | procs_terminate_childs (void) |
| | This function terminates all processes spawned with create_process. Calls terminate_child for each process active. In case init_procs was not called this function does nothing.
|
| int | terminate_process (pid_t pid) |
| | Terminates a given process. If termination does not work, the process will get killed. Terminate process can be called with the (-1 * pid) to send the signal to the process group.
|
| pid_t | create_ipc_process (ipc_process_func func, void *args) |
| | initializes a communication channels and calls a function with a new process
|
| const struct ipc_contexts * | procs_get_ipc_contexts (void) |
| | returns ipc_contexts.
|
| int | procs_cleanup_children (void) |
| | iterates through ipcc and verify if a child is stopped or killed to free the file handler.
|
◆ FORKFAILED
◆ NOCHILD
◆ NOINIT
◆ PROCSFULL
◆ process_func_t
| typedef void(* process_func_t) (void *) |
◆ create_ipc_process()
initializes a communication channels and calls a function with a new process
- Parameters
-
| func | Function to call |
| args | arguments |
- Returns
- pid of spawned process on success or one of the following errors: FORKFAILED
◆ procs_cleanup_children()
| int procs_cleanup_children |
( |
void | | ) |
|
iterates through ipcc and verify if a child is stopped or killed to free the file handler.
- Returns
- the amount of freed file handler or -1 on ipcc not initialized
◆ procs_get_ipc_contexts()
◆ procs_terminate_childs()
| void procs_terminate_childs |
( |
void | | ) |
|
This function terminates all processes spawned with create_process. Calls terminate_child for each process active. In case init_procs was not called this function does nothing.
◆ terminate_process()
| int terminate_process |
( |
pid_t | pid | ) |
|
Terminates a given process. If termination does not work, the process will get killed. Terminate process can be called with the (-1 * pid) to send the signal to the process group.
- Parameters
-
| pid | id of the child process |
- Returns
- int 0 on success, NOCHILD if child does not exist, NOINIT if not initialized