Thread (3 messages) 3 messages, 2 authors, 2025-11-09

[Bug 220723] New: the man page seccomp(2) instructs the user to include <linux/signal.h> and it causes conflicts

From: bugzilla-daemon@kernel.org
Date: 2025-10-29 21:15:36

https://bugzilla.kernel.org/show_bug.cgi?id=220723

            Bug ID: 220723
           Summary: the man page seccomp(2) instructs the user to include
                    <linux/signal.h> and it causes conflicts
           Product: Documentation
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: man-pages
          Assignee: documentation_man-pages@kernel-bugs.osdl.org
          Reporter: mpatocka@redhat.com
        Regression: No

The man page seccomp(2) instructs the user to include these files:

       #include <linux/seccomp.h>  /* Definition of SECCOMP_* constants */
       #include <linux/filter.h>   /* Definition of struct sock_fprog */
       #include <linux/audit.h>    /* Definition of AUDIT_* constants */
       #include <linux/signal.h>   /* Definition of SIG* constants */
       #include <sys/ptrace.h>     /* Definition of PTRACE_* constants */
       #include <sys/syscall.h>    /* Definition of SYS_* constants */
       #include <unistd.h>

However, the include file <linux/signal.h> defines sigset_t and struct timeval
and they clash with the glibc definition. <linux/signal.h> should be changed to
<signal.h> in the man page.

How to reproduce: Try to compile this program:

#include <linux/seccomp.h>
#include <linux/filter.h>
#include <linux/audit.h>
#include <linux/signal.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <unistd.h>

#include <stdlib.h>

int main(void)
{
        return 0;
}

You get these errors:
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:33,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:179,
                 from /usr/include/stdlib.h:395,
                 from seccomp.c:9:
/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h:7:20: error: conflicting
types for ‘sigset_t’; have ‘__sigset_t’
    7 | typedef __sigset_t sigset_t;
      |                    ^~~~~~~~
In file included from /usr/include/linux/signal.h:5,
                 from seccomp.c:4:
/usr/include/x86_64-linux-gnu/asm/signal.h:16:23: note: previous declaration of
‘sigset_t’ with type ‘sigset_t’ {aka ‘long unsigned int’}
   16 | typedef unsigned long sigset_t;
      |                       ^~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:37:
/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h:8:8: error:
redefinition of ‘struct timeval’
    8 | struct timeval
      |        ^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/asm/signal.h:7:
/usr/include/linux/time.h:16:8: note: originally defined here
   16 | struct timeval {
      |        ^~~~~~~

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help