The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v4 0/3] nolibc: Add fallocate()
@ 2026-05-07  9:03 Daniel Palmer
  2026-05-07  9:03 ` [PATCH v4 1/3] tools/nolibc: fcntl: " Daniel Palmer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Daniel Palmer @ 2026-05-07  9:03 UTC (permalink / raw)
  To: w, linux; +Cc: david.laight.linux, linux-kernel, Daniel Palmer

While poking around with my "static PIE for nommu" series I found
I needed fallocate(). Implementing it turned out a bit more
interesting than I thought it would be due to how the offset and
size need to be passed on 32bit machines.

v4:
 - Added statfs()...
 - Reworked the test a bit to use statfs() to work out if /tmp
   is a tmpfs or not and skip the test if it isn't. This skips
   the test on sparc32 where CONFIG_TMPFS=n.
 - Adding the needed bits to the sparc32 config to allow tmpfs
   to be enabled allows it to run and pass the test. I will check
   the changes and send a patch.
 - Cleaned up the if() around deciding how to pass the parameters
   for fallocate() based on the comments from David and Thomas.
 - Test passed on all of the supported targets.

v3:
 - Reworked the test a bit, ran it on all the targets I could get
   to run (s390, loongarch and sh currently don't work for me).
   sparc32 doesn't seem to support fallocate() so made it skip
   the test.
 - Rebase on nolibc/for-next with the large file support bits.

v2:
 - Addressed Thomas' comments
 - Trial and error'd a test for the arguments being passed correctly.
   Hopefully someone smarter than I am can tell if it actually works.

Daniel Palmer (3):
  tools/nolibc: fcntl: Add fallocate()
  tools/nolibc: Add statfs()
  selftests/nolibc: Add a very basic test for fallocate()

 tools/include/nolibc/Makefile                |  1 +
 tools/include/nolibc/arch-mips.h             | 11 +++
 tools/include/nolibc/fcntl.h                 | 31 +++++++++
 tools/include/nolibc/nolibc.h                |  1 +
 tools/include/nolibc/sys.h                   |  8 +++
 tools/include/nolibc/sys/statfs.h            | 50 ++++++++++++++
 tools/testing/selftests/nolibc/nolibc-test.c | 70 ++++++++++++++++++++
 7 files changed, 172 insertions(+)
 create mode 100644 tools/include/nolibc/sys/statfs.h


base-commit: bb2d82d41894cb30d836e9796ff67d2f9a71eccf
-- 
2.53.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-11  6:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07  9:03 [PATCH v4 0/3] nolibc: Add fallocate() Daniel Palmer
2026-05-07  9:03 ` [PATCH v4 1/3] tools/nolibc: fcntl: " Daniel Palmer
2026-05-07  9:03 ` [PATCH v4 2/3] tools/nolibc: Add statfs() Daniel Palmer
2026-05-07  9:03 ` [PATCH v4 3/3] selftests/nolibc: Add a very basic test for fallocate() Daniel Palmer
2026-05-11  6:29 ` [PATCH v4 0/3] nolibc: Add fallocate() Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox