5#ifndef MYSHELL_MSH_JOBS_H
6#define MYSHELL_MSH_JOBS_H
16#include "types/msh_process.h"
40void add_process(pid_t pid,
int flags,
const std::vector<std::string> &args);
std::map< pid_t, process > processes
The internal process table.
Definition msh_jobs.cpp:30
void remove_process(pid_t pid)
Remove a process from the internal process table.
Definition msh_jobs.cpp:208
void init_job_control()
Initialize job control.
Definition msh_jobs.cpp:40
void add_process(pid_t pid, int flags, const std::vector< std::string > &args)
Add a process to the internal process table.
Definition msh_jobs.cpp:199
int wait_for_process(pid_t pid, int *status)
Wait for the process to finish.
Definition msh_jobs.cpp:88
int no_background_processes()
Return the number of currently running background processes.
Definition msh_jobs.cpp:130
void update_jobs()
Update the internal process table.
Definition msh_jobs.cpp:185
void print_completed_processes()
Print all completed background processes.
Definition msh_jobs.cpp:165
int reap_children()
Wait for all background processes to finish.
Definition msh_jobs.cpp:114
void sigchld_handler(int)
SIGCHLD handler.
Definition msh_jobs.cpp:61
void print_processes()
Print all internal processes.
Definition msh_jobs.cpp:143
void set_process_status(pid_t pid, status_t status)
Change the status of a process in the internal process table.
Definition msh_jobs.cpp:218
Information about an internal process.
Definition msh_process.h:24