git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Externals/mesa - Incomplete makefile
[tpg/acess2.git]
/
Usermode
/
Libraries
/
libposix.so_src
/
unistd.c
diff --git
a/Usermode/Libraries/libposix.so_src/unistd.c
b/Usermode/Libraries/libposix.so_src/unistd.c
index
78896db
..
e41ebfd
100644
(file)
--- a/
Usermode/Libraries/libposix.so_src/unistd.c
+++ b/
Usermode/Libraries/libposix.so_src/unistd.c
@@
-11,6
+11,7
@@
#include <sys/select.h>
#include <stdio.h>
#include <string.h>
#include <sys/select.h>
#include <stdio.h>
#include <string.h>
+#include <acess/devices/pty.h>
// === CODE ===
int unlink(const char *pathname)
// === CODE ===
int unlink(const char *pathname)
@@
-78,6
+79,11
@@
int seek(int fd, int whence, off_t dest)
return _SysSeek(fd, whence, 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);
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];
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;
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;
}
return passbuf;
}
UCC
git Repository :: git.ucc.asn.au