help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How does tcgetpgrp program terminate the bash shell when the program is


From: Peng Yu
Subject: How does tcgetpgrp program terminate the bash shell when the program is called in the background?
Date: Tue, 23 Mar 2021 17:07:51 -0500

Hi,

#include <stdio.h>
#include <unistd.h>

int main() {
    printf("%d\n", tcgetpgrp(0));
    return 0;
}

When I run this program in the background (as ./prog &), it will
terminate the shell in which it runs. I don't understand why it can
terminate the shell. Could anybody help me understand why it is so?
Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]