diff options
| -rw-r--r-- | src/unistd/getpass.c | 2 | ||||
| -rw-r--r-- | src/unistd/sleep.c | 4 | ||||
| -rw-r--r-- | src/unistd/tcgetpgrp.c | 8 | ||||
| -rw-r--r-- | src/unistd/tcsetpgrp.c | 4 |
4 files changed, 11 insertions, 7 deletions
diff --git a/src/unistd/getpass.c b/src/unistd/getpass.c index 46165742..5c48e6c8 100644 --- a/src/unistd/getpass.c +++ b/src/unistd/getpass.c @@ -2,7 +2,7 @@ char *getpass(const char *prompt) { - return prompt; + return (char*)prompt; } /* diff --git a/src/unistd/sleep.c b/src/unistd/sleep.c index 9af72481..656f70f9 100644 --- a/src/unistd/sleep.c +++ b/src/unistd/sleep.c @@ -5,8 +5,8 @@ #if _POSIX_C_SOURCE < 199309 #define nanosleep __nanosleep -#include "../time/struct_timespec.c" -#include "../time/nanosleep.c" +#include "time/struct_timespec.c" +#include "time/nanosleep.c" #endif unsigned sleep(unsigned seconds) 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; } /* diff --git a/src/unistd/tcsetpgrp.c b/src/unistd/tcsetpgrp.c index e3cfe023..aef0acf5 100644 --- a/src/unistd/tcsetpgrp.c +++ b/src/unistd/tcsetpgrp.c @@ -1,11 +1,11 @@ #include "stddef.h" #include "sys/types.h" #include <unistd.h> +#include "termios/_termios.h" int tcsetpgrp(int fildes, pid_t pgid_id) { - (void)fildes; (void)pgid_id; - return 0; + return ioctl(fildes, TIOCSPGRP, &pgid_id); } /* |
