* We store the ID of the controlling terminal and the foreground process
group ID with the session and let the terminal update them. * Added an "orphaned" flag to the process_group structure and code to maintain it. * Handle the death of a controlling process correctly: The foreground process group gets a SIGHUP and all newly-orphaned process groups containing at least one stopped processes are sent SIGHUP+SIGCONT. * The tty handles the O_NOCTTY flag correctly, now. * The tty handles reads/writes from processes from other sessions correctly, now. * Handle tcsetpgrp() from background processes correctly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22187 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
#define O_EXCL 0x0100 /* exclusive creat */
|
||||
#define O_CREAT 0x0200 /* create and open file */
|
||||
#define O_TRUNC 0x0400 /* open with truncation */
|
||||
#define O_NOCTTY 0x1000 /* currently unsupported */
|
||||
#define O_NOCTTY 0x1000 /* don't make tty the controlling tty */
|
||||
#define O_NOTRAVERSE 0x2000 /* do not traverse leaf link */
|
||||
|
||||
/* flags for open() and fcntl() */
|
||||
|
||||
@@ -38,6 +38,9 @@ int32 team_used_teams(void);
|
||||
|
||||
void team_set_job_control_state(struct team* team, job_control_state newState,
|
||||
int signal, bool threadsLocked);
|
||||
void team_set_controlling_tty(int32 index);
|
||||
int32 team_get_controlling_tty();
|
||||
status_t team_set_foreground_process_group(int32 ttyIndex, pid_t processGroup);
|
||||
|
||||
status_t start_watching_team(team_id team, void (*hook)(team_id, void *),
|
||||
void *data);
|
||||
|
||||
@@ -67,6 +67,9 @@ struct death_entry {
|
||||
struct process_session {
|
||||
pid_t id;
|
||||
int32 group_count;
|
||||
int32 controlling_tty; // index of the controlling tty,
|
||||
// -1 if none
|
||||
pid_t foreground_group;
|
||||
};
|
||||
|
||||
struct process_group {
|
||||
@@ -74,6 +77,7 @@ struct process_group {
|
||||
struct process_session *session;
|
||||
pid_t id;
|
||||
struct team *teams;
|
||||
bool orphaned;
|
||||
};
|
||||
|
||||
struct team_loading_info {
|
||||
|
||||
Reference in New Issue
Block a user