diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2022-09-21 18:58:34 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2023-01-19 21:52:50 +0100 |
commit | 29b137af8098fa63b824072e1ce33883275959a3 (patch) | |
tree | af164fc77370f5c3f29d0597dc840d42bf77b6b4 /newlib | |
parent | 654072d7a2feadb7b4d7466e59105198ab5e0968 (diff) | |
download | newlib-29b137af8098fa63b824072e1ce33883275959a3.zip newlib-29b137af8098fa63b824072e1ce33883275959a3.tar.gz newlib-29b137af8098fa63b824072e1ce33883275959a3.tar.bz2 |
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>
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/libc/machine/nvptx/misc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/newlib/libc/machine/nvptx/misc.c b/newlib/libc/machine/nvptx/misc.c index 897ddc8..56e66b9 100644 --- a/newlib/libc/machine/nvptx/misc.c +++ b/newlib/libc/machine/nvptx/misc.c @@ -37,10 +37,21 @@ gettimeofday (struct timeval *tv, void *tz) { } 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) { } |