nvptx: Provide stub 'getpid', 'kill', 'stat'

... as implemented for GCN in 'newlib/libc/sys/amdgcn/*' files, but (for now)
still adding to the catch-all 'newlib/libc/machine/nvptx/misc.c' file.

This is necessary for the GCC/Fortran I/O system, for example.

Co-authored-by: Andrew Stubbs <ams@codesourcery.com>
This commit is contained in:
Thomas Schwinge 2022-09-21 18:58:34 +02:00
parent 654072d7a2
commit 29b137af80
1 changed files with 17 additions and 0 deletions

View File

@ -36,11 +36,22 @@ gettimeofday (struct timeval *tv, void *tz) {
return -1;
}
int
getpid (void) {
return 0;
}
int
isatty (int fd) {
return fd == 1;
}
int
kill (int pid, int sig) {
errno = ESRCH;
return -1;
}
off_t
lseek(int fd, off_t offset, int whence) {
return 0;
@ -56,6 +67,12 @@ read(int fd, void *buf, size_t count) {
return 0;
}
int
stat (const char *file, struct stat *pstat) {
errno = EACCES;
return -1;
}
void
sync (void) {
}