-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.c
More file actions
33 lines (30 loc) · 923 Bytes
/
Copy pathtest.c
File metadata and controls
33 lines (30 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#define _POSIX_SOURCE
#include <termios.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdio.h>
#include <signal.h>
// int main() {
// pid_t pid;
// int status;
// if (fork() == 0)
// if ((pid = tcgetpgrp(STDOUT_FILENO)) < 0)
// perror("tcgetpgrp() error");
// else {
// printf("original foreground process group id of stdout was %d\n",
// (int) pid);
// if (setpgid(getpid(), 0) != 0)
// perror("setpgid() error");
// else {
// printf("now setting to %d\n", (int) getpid());
// if (tcsetpgrp(STDOUT_FILENO, getpid()) != 0)
// perror("tcsetpgrp() error");
// else if ((pid = tcgetpgrp(STDOUT_FILENO)) < 0)
// perror("tcgetpgrp() error");
// else
// printf("new foreground process group id of stdout was %d\n",
// (int) pid);
// }
// }
// else wait(&status);
// }