public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] nvptx: Provide stub 'getpid', 'kill', 'stat'
@ 2023-01-20 19:36 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-01-20 19:36 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=29b137af8098fa63b824072e1ce33883275959a3
commit 29b137af8098fa63b824072e1ce33883275959a3
Author: Thomas Schwinge <thomas@codesourcery.com>
Date: Wed Sep 21 18:58:34 2022 +0200
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>
Diff:
---
newlib/libc/machine/nvptx/misc.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/newlib/libc/machine/nvptx/misc.c b/newlib/libc/machine/nvptx/misc.c
index 897ddc807..56e66b9f3 100644
--- a/newlib/libc/machine/nvptx/misc.c
+++ b/newlib/libc/machine/nvptx/misc.c
@@ -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) {
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-20 19:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-20 19:36 [newlib-cygwin] nvptx: Provide stub 'getpid', 'kill', 'stat' Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).