return ret;
}
+int access(const char *path, int openmode)
+{
+ errno = EINVAL;
+ return -1;
+}
+
int creat(const char *path, mode_t mode)
{
// TODO: Make native call to do this cheaper
return 0;
}
+unsigned int alarm(unsigned int seconds)
+{
+ static int64_t alarm_time;
+ if( seconds > 0 )
+ {
+ alarm_time = _SysTimestamp() + seconds * 1000;
+ // TODO: Schedule SIGALRM
+ }
+ return (alarm_time - _SysTimestamp()) / 1000;
+}
+
int kill(pid_t pid, int signal)
{
// TODO: Need special handling?
mode.OutputMode = 0;
_SysIOCtl(STDIN_FILENO, PTY_IOCTL_SETMODE, &mode);
fprintf(stderr, "%s", prompt);
+ fflush(stdin); // clear stdin buffer
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 -- )
_SysIOCtl(fd, PTY_IOCTL_GETID, NULL);
+ _SysDebug("TODO: ttyname_r");
+
return ENOTIMPL;
}