Start working on sessions and process groups.

This commit is contained in:
Andreas Kling 2018-11-02 12:56:51 +01:00
commit d8f0dd6f3b
Notes: sideshowbarker 2024-07-19 18:34:30 +09:00
8 changed files with 157 additions and 2 deletions

View file

@ -14,6 +14,7 @@ struct GlobalState {
const char* ttyname_short { nullptr };
char ttyname[32];
char hostname[32];
pid_t sid;
};
static GlobalState* g;
@ -171,6 +172,7 @@ static void greeting()
int main(int, char**)
{
g = new GlobalState;
g->sid = setsid();
int rc = gethostname(g->hostname, sizeof(g->hostname));
if (rc < 0)
perror("gethostname");