Bug 296489 - linux_xattr.c: use of undeclared identifier 'SSIZE_MAX'
Summary: linux_xattr.c: use of undeclared identifier 'SSIZE_MAX'
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 16.0-CURRENT
Hardware: i386 Any
: --- Affects Only Me
Assignee: freebsd-emulation (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2026-07-03 08:28 UTC by Dan Kotowski
Modified: 2026-07-10 15:07 UTC (History)
1 user (show)

See Also:
des: mfc-stable15+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Kotowski 2026-07-03 08:28:41 UTC
I've seen this a few times recently when building kernel on amd64 with TARGET_ARCH=i386:

/usr/local/src/sys/compat/linux/linux_xattr.c:356:15: error: use of undeclared identifier 'SSIZE_MAX'

I noticed that limits.h is explicitly included in several other sys/compat/linux/ c files. Explicitly including limits.h here as well does seem to resolve the build error, although I'm not sure if this breaks anything else.



diff --git a/sys/compat/linux/linux_xattr.c b/sys/compat/linux/linux_xattr.c
index 9a206089ada1..608e70706a0b 100644
--- a/sys/compat/linux/linux_xattr.c
+++ b/sys/compat/linux/linux_xattr.c
@@ -30,6 +30,7 @@
 #include <sys/extattr.h>
 #include <sys/fcntl.h>
 #include <sys/file.h>
+#include <sys/limits.h>
 #include <sys/namei.h>
 #include <sys/proc.h>
 #include <sys/syscallsubr.h>
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2026-07-03 18:42:44 UTC
^Triage: note that this Problem Report contains an in-line patch.
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-07-04 01:27:18 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=bcb471cfb499f61d98abdc7bfd48bee0e229b02b

commit bcb471cfb499f61d98abdc7bfd48bee0e229b02b
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-07-04 01:24:00 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-07-04 01:26:23 +0000

    sys/systm.h: include sys/limits.h for SSIZE_MAX

    This makes the header more self-contained.
    The symbol is needed only on 32bit arches, but the include file is
    provided unconditionally to make the namespace population predictable.

    PR:     296489
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week

 sys/sys/systm.h | 1 +
 1 file changed, 1 insertion(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-07-06 01:07:14 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=d1f7902fda830b38c6b0ca701b9e310aa3909228

commit d1f7902fda830b38c6b0ca701b9e310aa3909228
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-07-04 01:24:00 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-07-06 01:05:53 +0000

    sys/systm.h: include sys/limits.h for SSIZE_MAX

    PR:     296489

    (cherry picked from commit bcb471cfb499f61d98abdc7bfd48bee0e229b02b)

 sys/sys/systm.h | 1 +
 1 file changed, 1 insertion(+)