From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24C1F36CDFE for ; Thu, 7 May 2026 09:04:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778144658; cv=none; b=og2MMXFbmWzmPtr1Q0bFWhTqwKtPxHGGXXnubbwL2AO63xbW7UX1rTP+3hmmzOBcLfyr0W+rJHJY/TIrjO5u2Lt4ilObpcCwPEuOfKrlIiuYf5iOsjORTcsjqYgO5/2sw8QcXmMKTgH9u7zEV1RVrK1JLZgRPbewYMdF30jCdRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778144658; c=relaxed/simple; bh=rbt5/dsP9DHUqmbvfIqSVO3/09buZMuE3hgDAPfBIbM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WsUeESa1gpsJFoCC9DG9HaBxgQTMW0ANQsdbtWO2M8p3v5GoRD3RGdut51oLrxgpbHJ/vqdD5Is/JUi6ryRklmTst+11rNnaRVsvs4DUVGTRMh++14bFUZuhAEl83agbhYpDf+8mQvwj886pKoWdgefrGHmArcNfzfHUtMMu5OM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=thingy.jp; spf=pass smtp.mailfrom=0x0f.com; dkim=pass (1024-bit key) header.d=thingy.jp header.i=@thingy.jp header.b=I8vZptWc; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=thingy.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=0x0f.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thingy.jp header.i=@thingy.jp header.b="I8vZptWc" Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-c796163fac5so395610a12.1 for ; Thu, 07 May 2026 02:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thingy.jp; s=google; t=1778144647; x=1778749447; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=54WYmd1jya7iMWi8NnO/4hzVYppDHFlUx3LebG7ZmO4=; b=I8vZptWcWTmOJHrZ0RTnhQnib0IF/swZTtnQcozUTDVyTMhOJTmFCu0ur1+ej8pDuh T93f2sm/pGNuhLrBMvWXiM8Jx6LFNMPWEagaKsScKM0NeMITmpIXgRv8wRcKmGUGvxcF RQUF2ioun0L6pEVdI0myCQQyJJ2zqXu9laTSE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778144647; x=1778749447; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=54WYmd1jya7iMWi8NnO/4hzVYppDHFlUx3LebG7ZmO4=; b=FRKSPaRKFoEIOBeIRf6rnudahJKYGRxVctxXmQvotdA4qjNovJgmUH/idZd4LG5EM3 qtMjjxulSbogdDTFPdBuaDhd2eCzuIyzzlLYVo0+Qx/e0za1idYCcTMnT9g0AEl9ZBGQ cKlexfUyKi1FL0qAfh5uGycakWhu4rN5nbScGfCRMDvHKPnDic0JwYHdyOu/905hpF2S Woxxyxm65unketileMi93cweT8KevXotIKxG3bfqwZAzzQvd3XSf0y1wUfdLqbLRaeD/ 7063xhfIepCAvwBD+y1qT9SKvQ6zWtr7P4e9gnllFRC7NroUFkLVAtZergeV1lfsluqD 8hkg== X-Forwarded-Encrypted: i=1; AFNElJ+xMjIwUuEnLMJ/L6jGpuk1+EDdE+OH/ruPyjgUGPaZi62zro9gevVwt7OME+NpILGC7bR8L+PFjNwQ3Kc=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5rKwP4yF5GdSeEX2TI/GzqVeVkvrHqPTX8vOfd9q3tqDoSCDj l8PBeSxCDEfJ0DE+mpSPUNYh1K9Xjz/iun3vrUf6qbMLDsXR4GxMRer8+su3lGIDJk4= X-Gm-Gg: AeBDieu9HkDQxEG4nTI5FQpQxJaeay2QRW6/6DdzZXiq0tHrZBgs3uBnGzi517QjQha 6mR6RIS/ZAPB/pPVXHEpNUbsCV/lHkRuIO54MMEW5BgUh9qh98hBBbF3oO68Q7rAsTnXcC3cmZV dCrwetTu+C70yQ2e2+cnKNN43KabxRxAhMGJhKGNSl8hs+8Y+vg7Opmdmwj+hPepKfEvIgOwl0h LpnFpBQv1EX0XTZ+qKOI7MXemovvt/Gbct2wW5iztWtdSBMrAGWaQxi5Iiry+TWOE5uSrVpIkZS x3oMdULK/sQpHNVBDerKfBr1Vz/zixQp0SG71DXNc04zXHGeskPG8d2RZXUnGJyFCxu2qo3KpF/ KrEuXZFaDlheXIbocZMWiN5LXPaCeRjaF3WC8BkFV3qenTgl4AwHqQx8TwVxiitjOi7d67fgL7S siQuisFuSxvZ7GjCWdkiXHymrzw6VhTmoLV6Let0vPQvkzvP22FvtYEatwBUvRqg/HKhsM5VKnE iEQRTSoCo/NrrzZ7LkUr17B6co1z4RvYJPW2A== X-Received: by 2002:a17:903:144f:b0:2b9:9086:daac with SMTP id d9443c01a7336-2ba788287acmr75050305ad.0.1778144646955; Thu, 07 May 2026 02:04:06 -0700 (PDT) Received: from kinako.work.home.arpa (p1387170-ipxg00a01sizuokaden.shizuoka.ocn.ne.jp. [153.221.239.170]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2babaac34a4sm20061215ad.16.2026.05.07.02.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 02:04:06 -0700 (PDT) From: Daniel Palmer To: w@1wt.eu, linux@weissschuh.net Cc: david.laight.linux@gmail.com, linux-kernel@vger.kernel.org, Daniel Palmer Subject: [PATCH v4 0/3] nolibc: Add fallocate() Date: Thu, 7 May 2026 18:03:50 +0900 Message-ID: <20260507090353.356764-1-daniel@thingy.jp> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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