[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260205222329.2419035-2-jordanrichards@google.com>
Date: Thu, 5 Feb 2026 22:23:28 +0000
From: Jordan Richards <jordanrichards@...gle.com>
To: Pasha Tatashin <pasha.tatashin@...een.com>, Mike Rapoport <rppt@...nel.org>,
Pratyush Yadav <pratyush@...nel.org>, Shuah Khan <shuah@...nel.org>
Cc: Jason Miu <jasonmiu@...gle.com>, David Matlack <dmatlack@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
Jordan Richards <jordanrichards@...gle.com>
Subject: [PATCH v2 1/2] tools/nolibc: add ftruncate()
---
tools/include/nolibc/unistd.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h
index bb5e80f3f05d..845d10f48fd0 100644
--- a/tools/include/nolibc/unistd.h
+++ b/tools/include/nolibc/unistd.h
@@ -48,6 +48,17 @@ int access(const char *path, int amode)
return faccessat(AT_FDCWD, path, amode, 0);
}
+static __attribute__((unused))
+int sys_ftruncate(int fd, off_t length)
+{
+ return my_syscall2(__NR_ftruncate, fd, length);
+}
+
+static __attribute__((unused))
+int ftruncate(int fd, off_t length)
+{
+ return __sysret(sys_ftruncate(fd, length));
+}
static __attribute__((unused))
int msleep(unsigned int msecs)
--
2.53.0.rc2.204.g2597b5adb4-goog
Powered by blists - more mailing lists