Date: Wed, 11 Jan 2023 00:30:52 +0100 From: Mateusz Guzik <mjguzik@gmail.com> To: Jake Freeland <jake@technologyfriends.net> Cc: freebsd-hackers@freebsd.org Subject: Re: Syscalls: eventfd and timerfd Message-ID: <CAGudoHHd%2BqixeXW_V3f4pXWG8-Bi6eAbUHBGY6033W8P-JBivA@mail.gmail.com> In-Reply-To: <CAOgZAGbK5H=JtxY7MZKyyXa=i=CXbYtV4tCOvg6N-CRYjqJ4fQ@mail.gmail.com> References: <CAOgZAGbK5H=JtxY7MZKyyXa=i=CXbYtV4tCOvg6N-CRYjqJ4fQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
It is added with a non-standard entry point. If you git log -p sys/kern/sys_eventfd.c you will see: commit 7a202823aa54ba18c485bdbcf355269bcfee1ab9 Author: Konstantin Belousov <kib@FreeBSD.org> Date: Wed Dec 23 16:14:04 2020 +0200 Expose eventfd in the native API/ABI using a new __specialfd syscall then if you git grep __specialfd: lib/libc/gen/eventfd.c: return (__sys___specialfd(SPECIALFD_EVENTFD, &args, sizeof(args))); lib/libc/include/libc_private.h:int __sys___specialfd(int, const void *, __size_t); sys/compat/freebsd32/freebsd32_syscall.h:#define FREEBSD32_SYS___specialfd 577 sys/compat/freebsd32/freebsd32_syscalls.c: "__specialfd", /* 577 = __specialfd */ sys/compat/freebsd32/freebsd32_sysent.c: { .sy_narg = AS(__specialfd_args), .sy_call = (sy_call_t *)sys___specialfd, .sy_auevent = AUE_SPECIALFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 577 = __specialfd */ sys/compat/freebsd32/freebsd32_systrace_args.c: /* __specialfd */ sys/compat/freebsd32/freebsd32_systrace_args.c: struct __specialfd_args *p = params; sys/compat/freebsd32/freebsd32_systrace_args.c: /* __specialfd */ sys/compat/freebsd32/freebsd32_systrace_args.c: /* __specialfd */ sys/kern/init_sysent.c: { .sy_narg = AS(__specialfd_args), .sy_call = (sy_call_t *)sys___specialfd, .sy_auevent = AUE_SPECIALFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 577 = __specialfd */ sys/kern/sys_generic.c:sys___specialfd(struct thread *td, struct __specialfd_args *args) sys/kern/syscalls.c: "__specialfd", /* 577 = __specialfd */ sys/kern/syscalls.master: int __specialfd( sys/kern/systrace_args.c: /* __specialfd */ sys/kern/systrace_args.c: struct __specialfd_args *p = params; sys/kern/systrace_args.c: /* __specialfd */ sys/kern/systrace_args.c: /* __specialfd */ sys/sys/syscall.h:#define SYS___specialfd 577 sys/sys/syscall.mk: __specialfd.o \ sys/sys/sysproto.h:struct __specialfd_args { sys/sys/sysproto.h:int sys___specialfd(struct thread *, struct __specialfd_args *); sys/sys/sysproto.h:#define SYS_AUE___specialfd AUE_SPECIALFD On 1/11/23, Jake Freeland <jake@technologyfriends.net> wrote: > Hi there, > > I am currently working on moving the linux_compat implementation of > timerfd (in sys/compat/linux/linux_event.c) into its own FreeBSD syscall > similar to what was done for eventfd. This is my first time implementing > a syscall, so I have been following the eventfd implementation as a > reference. I noticed that the eventfd syscall entries are absent from > sys/kern/syscalls.master and I am not sure why. Was eventfd never > formally added as a syscall entry or am I missing something? I was > planning on adding timerfd entries to syscalls.master, but now I am > unsure how to proceed. > > I apologize for my ignorance. This process is new to me. > > Thank you, > Jake Freeland > -- Mateusz Guzik <mjguzik gmail.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGudoHHd%2BqixeXW_V3f4pXWG8-Bi6eAbUHBGY6033W8P-JBivA>