X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2Flibposix.so_src%2Funistd.c;h=e41ebfd0894f1f4778c9daa7c0581df7634c513f;hb=ad12abcd42d1c8f0bd196c6c824a054545cf66d2;hp=78896db9e7cfb064f1f7a69605c0bb0ce3ae21e7;hpb=edddd69f17803d29b7f435da85ef23b7a5430c1f;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/libposix.so_src/unistd.c b/Usermode/Libraries/libposix.so_src/unistd.c index 78896db9..e41ebfd0 100644 --- a/Usermode/Libraries/libposix.so_src/unistd.c +++ b/Usermode/Libraries/libposix.so_src/unistd.c @@ -11,6 +11,7 @@ #include #include #include +#include // === CODE === int unlink(const char *pathname) @@ -78,6 +79,11 @@ int seek(int fd, int whence, off_t dest) return _SysSeek(fd, whence, dest); } +off_t lseek(int fd, off_t offset, int whence) +{ + return _SysSeek(fd, whence, offset); +} + off_t tell(int fd) { return _SysTell(fd); @@ -180,11 +186,19 @@ int mkdir(const char *pathname, mode_t mode) char *getpass(const char *prompt) { static char passbuf[PASS_MAX+1]; + struct ptymode oldmode, mode; + _SysIOCtl(STDIN_FILENO, PTY_IOCTL_GETMODE, &oldmode); + mode.InputMode = PTYIMODE_CANON; + mode.OutputMode = 0; + _SysIOCtl(STDIN_FILENO, PTY_IOCTL_SETMODE, &mode); fprintf(stderr, "%s", prompt); fgets(passbuf, PASS_MAX+1, stdin); fprintf(stderr, "\n"); for( int i = strlen(passbuf); i > 0 && (passbuf[i-1] == '\r' || passbuf[i-1] == '\n'); i -- ) passbuf[i-1] = 0; + + _SysIOCtl(STDIN_FILENO, PTY_IOCTL_SETMODE, &oldmode); + return passbuf; }