Pseudo-implement syscalls: lseek, close, fstat, isatty, raise, read
This commit is contained in:
parent
c9845b3687
commit
e780de19b4
|
@ -15,7 +15,7 @@ _read (int file,
|
|||
char *ptr,
|
||||
int len)
|
||||
{
|
||||
return -1;
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -23,7 +23,7 @@ _lseek (int file,
|
|||
int ptr,
|
||||
int dir)
|
||||
{
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -38,7 +38,7 @@ _write ( int file,
|
|||
int
|
||||
_close (int file)
|
||||
{
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -58,7 +58,9 @@ int
|
|||
_fstat (int file,
|
||||
struct stat *st)
|
||||
{
|
||||
return -1;
|
||||
/* All files are regarded as character special devices */
|
||||
st->st_mode = S_IFCHR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -83,9 +85,10 @@ _unlink ()
|
|||
}
|
||||
|
||||
|
||||
_isatty (fd)
|
||||
int fd;
|
||||
int
|
||||
_isatty (int fd)
|
||||
{
|
||||
/* Every output stream is a terminal */
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -116,9 +119,9 @@ raise(int sig)
|
|||
|
||||
int
|
||||
_stat (const char *path, struct stat *st)
|
||||
|
||||
{
|
||||
return -1;
|
||||
st->st_mode = S_IFCHR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in New Issue