mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Palmer <daniel@thingy.jp>
To: w@1wt.eu, linux@weissschuh.net
Cc: linux-kernel@vger.kernel.org, Daniel Palmer <daniel@thingy.jp>
Subject: [PATCH v2 0/2] nolibc: Add fallocate()
Date: Fri, 17 Apr 2026 20:26:20 +0900	[thread overview]
Message-ID: <20260417112622.1182216-1-daniel@thingy.jp> (raw)

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.

I have ran the tests on m68k, arm, arm64, riscv[32|64], x86_64,
i386, x32 (v2: + lots of mips, ppc..) . I probably missed something,
maybe there is a better way to do this. Maybe it can't actually
pass an offset or size >4GB on x32? (v2: I think this is good now)

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 (2):
  tools/nolibc: fcntl: Add fallocate()
  selftests/nolibc: Add a very basic test for fallocate()

 tools/include/nolibc/arch-mips.h             | 11 ++++
 tools/include/nolibc/fcntl.h                 | 32 +++++++++++
 tools/include/nolibc/sys.h                   |  8 +++
 tools/testing/selftests/nolibc/nolibc-test.c | 58 ++++++++++++++++++++
 4 files changed, 109 insertions(+)

-- 
2.51.0


             reply	other threads:[~2026-04-17 11:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17 11:26 Daniel Palmer [this message]
2026-04-17 11:26 ` [PATCH v2 1/2] tools/nolibc: fcntl: " Daniel Palmer
2026-04-17 11:26 ` [PATCH v2 2/2] selftests/nolibc: Add a very basic test for fallocate() Daniel Palmer
2026-04-27 20:01 ` [PATCH v2 0/2] nolibc: Add fallocate() Thomas Weißschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260417112622.1182216-1-daniel@thingy.jp \
    --to=daniel@thingy.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome