Date: Sat, 01 Jul 2023 04:22:35 -0700 From: "Pat Maddox" <pat@patmaddox.com> To: freebsd-hackers@freebsd.org Subject: Re: How are syscall functions defined? Message-ID: <32a0f7e7-11b7-443e-a601-40bec7798d8f@app.fastmail.com> In-Reply-To: <5f311275-e307-4e78-a479-c6d4e7f116d5@app.fastmail.com> References: <5f311275-e307-4e78-a479-c6d4e7f116d5@app.fastmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 1, 2023, at 3:11 AM, Pat Maddox wrote: > jail_attach is defined in syscalls.master [1] which generates a=20 > declaration in jail.h [2]. Try as I might, I can=E2=80=99t find any de= finition=20 > of that specific syscall function (or any other). I think the closest=20 > I=E2=80=99ve found is sys_jail_attach in kern_jail.c [3]. I suspect th= ere=E2=80=99s=20 > some generation going on that defines jail_attach - but if that=E2=80=99= s the=20 > case, I haven=E2=80=99t been able to track it down. > > Can someone point me to how the C function gets defined? > > Thanks, > Pat > > [1]=20 > https://github.com/freebsd/freebsd-src/blob/releng/13.2/sys/kern/sysca= lls.master#L2307 > [2]=20 > https://github.com/freebsd/freebsd-src/blob/releng/13.2/sys/sys/jail.h= #L119 > [3]=20 > https://github.com/freebsd/freebsd-src/blob/releng/13.2/sys/kern/kern_= jail.c#L2340 Symbol.map [1] is used to produce a version map [2] which is then fed to= the linker [3], which I assume maps the symbols in the resulting binary= . I intend to experiment with that a bit, but I think that makes sense. Pat [1] https://github.com/freebsd/freebsd-src/blob/releng/13.2/lib/libc/sys= /Symbol.map#L672 [2] https://github.com/freebsd/freebsd-src/blob/releng/13.2/share/mk/bsd= .symver.mk#L43 [3] https://github.com/freebsd/freebsd-src/blob/releng/13.2/share/mk/bsd= .lib.mk#L253
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32a0f7e7-11b7-443e-a601-40bec7798d8f>