From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 9C3BD3858409; Fri, 20 Jan 2023 19:36:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C3BD3858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674243419; bh=lZrLM4J5XI+G0n4MWogcHlG4TJ6O3EFj4TicRi5T3gw=; h=From:To:Subject:Date:From; b=fCMSPurK+sDCNCCP885Aeril5qq87SDp3FqvzVk13/wsbWeu8n8w7qgyp963M/rqc iDe0suq1O4Jqy0q9Wq2KAhXIO18LJuMei6ydrw06pbQNCygm/SzvA+vEfeeVxEGYTf 1nmZg0kC5vpM8my3OFoTxfWsj08NN0fg9g7nIDx4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Thomas Schwinge To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] nvptx: Provide stub 'getpid', 'kill', 'stat' X-Act-Checkin: newlib-cygwin X-Git-Author: Thomas Schwinge X-Git-Refname: refs/heads/master X-Git-Oldrev: 654072d7a2feadb7b4d7466e59105198ab5e0968 X-Git-Newrev: 29b137af8098fa63b824072e1ce33883275959a3 Message-Id: <20230120193659.9C3BD3858409@sourceware.org> Date: Fri, 20 Jan 2023 19:36:59 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D29b137af809= 8fa63b824072e1ce33883275959a3 commit 29b137af8098fa63b824072e1ce33883275959a3 Author: Thomas Schwinge Date: Wed Sep 21 18:58:34 2022 +0200 nvptx: Provide stub 'getpid', 'kill', 'stat' =20 ... as implemented for GCN in 'newlib/libc/sys/amdgcn/*' files, but (fo= r now) still adding to the catch-all 'newlib/libc/machine/nvptx/misc.c' file. =20 This is necessary for the GCC/Fortran I/O system, for example. =20 Co-authored-by: Andrew Stubbs 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/m= isc.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; } =20 +int +getpid (void) { + return 0; +} + int isatty (int fd) { return fd =3D=3D 1; } =20 +int +kill (int pid, int sig) { + errno =3D 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; } =20 +int +stat (const char *file, struct stat *pstat) { + errno =3D EACCES; + return -1; +} + void sync (void) { }