<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/include/nolibc/stdio.h, branch linux-7.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-05-23T11:08:32+00:00</updated>
<entry>
<title>tools/nolibc/printf: Move snprintf length check to callback</title>
<updated>2026-05-23T11:08:32+00:00</updated>
<author>
<name>David Laight</name>
<email>david.laight.linux@gmail.com</email>
</author>
<published>2026-03-02T10:17:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ab61bd33bffdbb602d5f4a6840a46c04d7aff677'/>
<id>urn:sha1:ab61bd33bffdbb602d5f4a6840a46c04d7aff677</id>
<content type='text'>
[ Upstream commit 4045e7b19bbf7338452cda11e64cfe7ae3361964 ]

Move output truncation to the snprintf() callback.
This simplifies the main code and fixes truncation of padded fields.

Add a zero length callback to 'finalise' the buffer rather than
doing it in snprintf() itself.

Fixes: e90ce42e81381 ("tools/nolibc: implement width padding in printf()")
Signed-off-by: David Laight &lt;david.laight.linux@gmail.com&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://patch.msgid.link/20260302101815.3043-3-david.laight.linux@gmail.com
[Thomas: clean up Fixes trailer]
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/nolibc/printf: Change variables 'c' to 'ch' and 'tmpbuf[]' to 'outbuf[]'</title>
<updated>2026-05-23T11:08:32+00:00</updated>
<author>
<name>David Laight</name>
<email>david.laight.linux@gmail.com</email>
</author>
<published>2026-02-23T10:17:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e23746a77200f3bc9c57c147e28636b6d65ec497'/>
<id>urn:sha1:e23746a77200f3bc9c57c147e28636b6d65ec497</id>
<content type='text'>
[ Upstream commit f675ae28fcdf7db93a8c1a6964f062725b1e06a0 ]

Changing 'c' makes the code slightly easier to read because the variable
stands out from the single character literals (especially 'c').

Change tmpbuf[] to outbuf[] because 'out' points into it.

The following patches pretty much rewrite the function so the
churn is limited.

Signed-off-by: David Laight &lt;david.laight.linux@gmail.com&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://patch.msgid.link/20260223101735.2922-7-david.laight.linux@gmail.com
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Stable-dep-of: 4045e7b19bbf ("tools/nolibc/printf: Move snprintf length check to callback")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: Add fseek() to stdio.h</title>
<updated>2026-01-11T11:47:47+00:00</updated>
<author>
<name>Daniel Palmer</name>
<email>daniel@thingy.jp</email>
</author>
<published>2026-01-05T02:36:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=109770cc81680b802ee983b09b61c3979240fd09'/>
<id>urn:sha1:109770cc81680b802ee983b09b61c3979240fd09</id>
<content type='text'>
A very basic wrapper around lseek() that implements fseek().

Signed-off-by: Daniel Palmer &lt;daniel@thingy.jp&gt;
Link: https://patch.msgid.link/20260105023629.1502801-3-daniel@thingy.jp
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: Add fread() to stdio.h</title>
<updated>2026-01-11T11:47:47+00:00</updated>
<author>
<name>Daniel Palmer</name>
<email>daniel@thingy.jp</email>
</author>
<published>2026-01-05T02:36:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=edaf30743185f6ed8e29dcb2f1d01e183c0b807b'/>
<id>urn:sha1:edaf30743185f6ed8e29dcb2f1d01e183c0b807b</id>
<content type='text'>
Add a very basic version of fread() like we already have for fwrite().

Signed-off-by: Daniel Palmer &lt;daniel@thingy.jp&gt;
Link: https://patch.msgid.link/20260105023629.1502801-2-daniel@thingy.jp
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: implement %m if errno is not defined</title>
<updated>2025-10-29T15:29:15+00:00</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin.berg@intel.com</email>
</author>
<published>2025-09-24T14:20:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fbd1b7f6b322a63b21ebbf00c732a17bb8bdb5d4'/>
<id>urn:sha1:fbd1b7f6b322a63b21ebbf00c732a17bb8bdb5d4</id>
<content type='text'>
For improved compatibility, print %m as "unknown error" when nolibc is
compiled using NOLIBC_IGNORE_ERRNO.

Signed-off-by: Benjamin Berg &lt;benjamin.berg@intel.com&gt;
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc/stdio: let perror work when NOLIBC_IGNORE_ERRNO is set</title>
<updated>2025-10-29T15:29:13+00:00</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin.berg@intel.com</email>
</author>
<published>2025-09-24T14:20:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c485ca3aff2442adea4c08ceb5183e671ebed22a'/>
<id>urn:sha1:c485ca3aff2442adea4c08ceb5183e671ebed22a</id>
<content type='text'>
There is no errno variable when NOLIBC_IGNORE_ERRNO is defined. As such,
simply print the message with "unknown error" rather than the integer
value of errno.

Fixes: acab7bcdb1bc ("tools/nolibc/stdio: add perror() to report the errno value")
Signed-off-by: Benjamin Berg &lt;benjamin.berg@intel.com&gt;
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>selftests/nolibc: correctly report errors from printf() and friends</title>
<updated>2025-07-06T09:02:40+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2025-07-04T13:43:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a40129087a4c32135bb1177a57bbbe6ee646f1a'/>
<id>urn:sha1:4a40129087a4c32135bb1177a57bbbe6ee646f1a</id>
<content type='text'>
When an error is encountered by printf() it needs to be reported.
errno() is already set by the callback.

sprintf() is different, but that keeps working and is already tested.

Also add a new test.

Fixes: 7e4346f4a3a6 ("tools/nolibc/stdio: add a minimal [vf]printf() implementation")
Signed-off-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20250704-nolibc-printf-error-v1-2-74b7a092433b@linutronix.de
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: add fopen()</title>
<updated>2025-05-21T13:32:14+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2025-04-28T12:40:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a009a0c6faa9e7ffac13d55ef6cdac1f9a68efbe'/>
<id>urn:sha1:a009a0c6faa9e7ffac13d55ef6cdac1f9a68efbe</id>
<content type='text'>
This is used in various selftests and will be handy when integrating
those with nolibc.

Only the standard POSIX modes are supported.
No extensions nor the (noop) "b" from ISO C are accepted.

Signed-off-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20250428-nolibc-misc-v2-13-3c043eeab06c@linutronix.de
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: add %m printf format</title>
<updated>2025-05-21T13:32:01+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2025-04-28T12:40:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7a7cd445d9275be8e4650d390156595685c3ac03'/>
<id>urn:sha1:7a7cd445d9275be8e4650d390156595685c3ac03</id>
<content type='text'>
The %m format can be used to format the current errno.
It is non-standard but supported by other commonly used libcs like glibc and
musl, so applications do rely on them.

Signed-off-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20250428-nolibc-misc-v2-2-3c043eeab06c@linutronix.de
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
</content>
</entry>
<entry>
<title>tools/nolibc: include nolibc.h early from all header files</title>
<updated>2025-05-21T13:31:50+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>thomas.weissschuh@linutronix.de</email>
</author>
<published>2025-04-24T11:48:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3785289f97e2118b157332ffaae9fd2ec71237c8'/>
<id>urn:sha1:3785289f97e2118b157332ffaae9fd2ec71237c8</id>
<content type='text'>
Inclusion of any nolibc header file should also bring all other headers.
On the other hand it should also be possible to include any nolibc header
files
in any order.

Currently this is implemented by including the catch-all nolibc.h after the
headers own definitions.
This is problematic if one nolibc header depends on another one.
The first header has to include the other one before defining any symbols.
That in turn will include the rest of nolibc while the current header has
not defined anything yet. If any other part of nolibc depends on
definitions from the current header, errors are encountered.
This is already the case today. Effectively nolibc can only be included in
the order of nolibc.h.

Restructure the way "nolibc.h" is included.
Move it to the beginning of the header files and before the include guards.
Now any header will behave exactly like "nolibc.h" while the include
guards prevent any duplicate definitions.

Signed-off-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Acked-by: Willy Tarreau &lt;w@1wt.eu&gt;
Link: https://lore.kernel.org/r/20250424-nolibc-header-check-v1-2-011576b6ed6f@linutronix.de
</content>
</entry>
</feed>
