From nobody Tue Jan 10 23:30:52 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ns6WL5LdGz2qn2Q for ; Tue, 10 Jan 2023 23:30:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ns6WL3SjFz3PWr for ; Tue, 10 Jan 2023 23:30:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x234.google.com with SMTP id o66so11457956oia.6 for ; Tue, 10 Jan 2023 15:30:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aBPRip8WGRPQ2/qNQYdBguGWqs9EwvYYvO5MtwasnLs=; b=DlCBsgmZT+iwskspSgWs/DHsQrg5w8BzsS1j6y6cE/Gg8GKmYaBju/h+8L1UoAzOst xTqAr49vCcK7fkLLue79ykwopnGYgtvLRyocjl8yOIvMHhDBFpVtPP0W9HccEqh6oQOe M3NOEhOH6XVo9BfEiWIwQtLvws7C66UVgfj5RtnfMbAaTwodn3LzN6TPx9xVrXbm5/DJ hI3tgYIYBYYF0aFKgfd1JOZiopV84g6TrRyXFtJAVSITHSZvZW35cdG24G3E9R1FMtVC pja24dcTHUZim9nPwoL/TQVVj8imyGL3rFuj9zJVqJunv9nInWMfwZL3GH9wYE0z60XX N/rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aBPRip8WGRPQ2/qNQYdBguGWqs9EwvYYvO5MtwasnLs=; b=ASzvOvTGsHLO9t1VLpvVF0YjKjAHpzvYTqoi2nUKGam3GmD+WZehTTJlE3LhY+llFB 4FSnwnemVjhGkQnN6P0vwM/u+mWMlranDD75kezeuI8DGSFxyJ0dCOCwziRlAggGRH6m nvdHCoFpFsV5HWnstoojhceO0wzkjlUcb0480FJSaXQTyxVkRAHn6ZFK3Ne9EIakHxcV yzjmlYMtPS4jZZ6kHLGjBUwqD81ZJDu/hndFGuGMmhlrtTd10HhyZ6qms3qW6xELUKOd QDMkJW7EcsoOnDncvZR8ejIkO0Vu4Llko2h3t9X+X6aA04vC66eZu8d/BYbVh6Au/vyG iqwg== X-Gm-Message-State: AFqh2krVRKrKs4hF8jA/E/uNzMIJyyJqDVABUNwLMu7MsE9HRDaLHICW uRjrLeqtWyUoqfxhF63zwtyDYU7QDtSk03vlYuY= X-Google-Smtp-Source: AMrXdXvriTfxKjhCHBHCL4POxxGAm8uvQpbzI6xEr+pkQJ9okCghN2FEI/iyCSns4CE7lWH1Uu01Ifok4tj92pQQzvc= X-Received: by 2002:a05:6808:aaf:b0:35e:4337:35a8 with SMTP id r15-20020a0568080aaf00b0035e433735a8mr2927066oij.81.1673393453633; Tue, 10 Jan 2023 15:30:53 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Received: by 2002:ac9:77d5:0:b0:491:8368:9bdd with HTTP; Tue, 10 Jan 2023 15:30:52 -0800 (PST) In-Reply-To: References: From: Mateusz Guzik Date: Wed, 11 Jan 2023 00:30:52 +0100 Message-ID: Subject: Re: Syscalls: eventfd and timerfd To: Jake Freeland Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4Ns6WL3SjFz3PWr X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N 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 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 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