summaryrefslogtreecommitdiff
path: root/src/unistd/tcgetpgrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd/tcgetpgrp.c')
-rw-r--r--src/unistd/tcgetpgrp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/unistd/tcgetpgrp.c b/src/unistd/tcgetpgrp.c
index 13610d63..40b60a7e 100644
--- a/src/unistd/tcgetpgrp.c
+++ b/src/unistd/tcgetpgrp.c
@@ -1,11 +1,15 @@
#include "stddef.h"
#include "sys/types.h"
#include <unistd.h>
+#include "termios/_termios.h"
pid_t tcgetpgrp(int fildes)
{
- (void)fildes;
- return 0;
+ pid_t pid = -1;
+ if (ioctl(fildes, TIOCGPGRP, &pid) == -1) {
+ return (pid_t)-1;
+ }
+ return pid;
}
/*