Bug 255936 - syscall module example (share/examples/kld/syscall/module/syscall.c) fails to compile
Summary: syscall module example (share/examples/kld/syscall/module/syscall.c) fails to...
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-16 20:51 UTC by Scotty
Modified: 2021-06-09 10:32 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scotty 2021-05-16 20:51:00 UTC
I tried to compile the example but I got this error:

syscall.c:55:2: error: incompatible function pointer types initializing 'systrace_args_func_t' (aka 'void (*)(int, void *, unsigned long *, int *)') with an expression of type 'int (struct thread *, void *)' [-Werror,-Wincompatible-function-pointer-types]
        hello                   /* sy_call */
        ^~~~~
1 error generated.
*** Error code 1


the 'struct sysent' is different in FreeBSD 13 STABLE
Comment 1 Fernando Apesteguía freebsd_committer freebsd_triage 2021-05-19 13:39:54 UTC
(In reply to Scotty from comment #0)
Hi Scotty,

Where is this example? Is it in a man page? In out website?

Thanks!
Comment 2 Mateusz Piotrowski freebsd_committer freebsd_triage 2021-05-19 13:52:20 UTC
(In reply to Fernando Apesteguía from comment #1)

I guess it's about share/examples/kld/syscall/module/syscall.c in the src tree.
Comment 3 Scotty 2021-05-19 19:11:33 UTC
yeah my bad, it's in man(9) SYSCALL_MODULE
Comment 4 Fernando Apesteguía freebsd_committer freebsd_triage 2021-05-27 12:55:32 UTC
https://reviews.freebsd.org/D30498
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-06-09 10:31:31 UTC
A commit in branch main references this bug:

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

commit dc318a4ffabcbfa23bb56a33403aad36e6de30af
Author:     Fernando Apesteguía <fernape@FreeBSD.org>
AuthorDate: 2021-05-27 12:09:39 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2021-06-09 10:24:26 +0000

    Fix syscall kld example

    PR:     255936
    Reported by:    splitface@mailfence.com
    Approved by:    gbe (mentor), imp@, jilles@
    Differential Revision:  https://reviews.freebsd.org/D30498

 share/examples/kld/syscall/module/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 6 Fernando Apesteguía freebsd_committer freebsd_triage 2021-06-09 10:32:47 UTC
Committed,

Thanks!