From nobody Fri Mar 28 13:28:04 2025 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 4ZPLv20Qr2z5rrMV for ; Fri, 28 Mar 2025 13:28:14 +0000 (UTC) (envelope-from vadimnuclight@gmail.com) Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZPLv15ZLKz3QHs; Fri, 28 Mar 2025 13:28:13 +0000 (UTC) (envelope-from vadimnuclight@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-549b116321aso2622571e87.3; Fri, 28 Mar 2025 06:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743168491; x=1743773291; darn=freebsd.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=K+mE4nTFhXcy7UY3JsCX36r8vq9LpAYqc8g8RYuVofA=; b=dNispq3H4OdRAm+NiA0dr57sFCtmx8tUGDJX7JzKbfVD42nA/bmHTZohgQCKVxRGxG fv+qobBDHzmqhk/2Z5+YrCtkXfXGjvnw/7YTLj+kt3TyJ/YuQKaFU9eor7XG0CRm1oc+ YM6i4TLhHDRwcDRPe2dZTsdEDLFdcp8UIY2la07UeThmMtzWrKG/xZwM3yX0XS3JUENJ jib+NQwhyKWppGSCFEhJ4n4D2Yoyr6rA7HmrGb/3m+8JXkisggfHc0WI1ow5nURvPaY6 7CGAPDS9DSOaVxYBOX993kaJSzV3VyiEQoal9bwj/NX0rVxpSzYPqQxAZJWnKgF7E8Av d9Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743168491; x=1743773291; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K+mE4nTFhXcy7UY3JsCX36r8vq9LpAYqc8g8RYuVofA=; b=cCq0nRQBCeM4fMb0YTLQsRjq8KPNzupQNx+HXpVW0nUlERPy7DqntI2d+eGqg64Fw5 h7Y7xW/O9Bf75A/41sMKU0QK0KBjLDJfnnPHV0Iz5vIPvi5wvZ59miaKukIFAVfavuCR AoTEoFeEnB+iSsCIGquS3pgcOxegYS8Gt2Pi3GcP1GQtoTCsnV8NmOttBMztGj7IFr3f i/5yqUnQKXTaBKksy8xYLE02VgHVTTE/Cuk1brKz8QG1/UdqVZ2H6WUeR8MZr3L1nOAz 89xRfviErTJBTLU0N/FXb1VMOAw8F25b+tLNJKOcdJAki4orTuYQF0WLO27ZVHqx24ud zKEg== X-Gm-Message-State: AOJu0Yyp/QbQr00YrZekds9n0x+p/POb/Z5j/jXoD7kS9PR5oYLXbQo6 2WPCNEvMabUeZP6QYpE/hmAOww0zXVYbauC72/dDpCMNllEZNgcHyXEPFA== X-Gm-Gg: ASbGncszQK77/7sdxRlJ2aJ0lXVMcHPe+bSS+9PIxH2LwgpdAnDn9G0/13RFOt3SuWi fUUnHeSJWr1pEzHdXTCaLdChOafOM9hYmQz6QX27x97mMoVV6QDkpskadHaDNaVSWj3fqRIW/a2 Vwff8gQLyEv3KPe6PkDFtMx8T/PalBY2OSgmC6K6Ym/HJXan4HwYPeZ2F3KFp+m+O6pxmtGZR61 Bbs1NtWwD+1Ifx+G3mlgAhK9VQw5/ZUqq7cBaZokR5HrU/3cPgjayUAzYSruIg78aTwMl4/QhZt gRHFVPc4xqvnMKmLy98ya8ViLxMQJgvzuGnSoreMaa8EgCJwZo7lyjLNDrU96M0nhSnGX9h5CrR 4UkwOMDbCGgQ= X-Google-Smtp-Source: AGHT+IEndDpSlpmb/qZFCXPKGcVYRRQ+xBTuq0PXroLL7P/Oub0+vSEfj8823G7oXGrshOaWgvOt9w== X-Received: by 2002:a05:6512:10cd:b0:54a:cc25:dbe9 with SMTP id 2adb3069b0e04-54b011e06b0mr3178540e87.26.1743168491190; Fri, 28 Mar 2025 06:28:11 -0700 (PDT) Received: from nuclight.lan (broadband-37-110-95-35.ip.moscow.rt.ru. [37.110.95.35]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54b094bb3c3sm312005e87.2.2025.03.28.06.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:28:11 -0700 (PDT) Date: Fri, 28 Mar 2025 16:28:04 +0300 From: Vadim Goncharov To: Gleb Popov Cc: freebsd-hackers Subject: Re: Would we want pidfd_open(2) & SO_PEERPIDFD? Message-ID: <20250328162804.19125ac1@nuclight.lan> In-Reply-To: References: X-Mailer: Claws Mail 3.21.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.4) 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4ZPLv15ZLKz3QHs X-Spamd-Bar: ---- On Fri, 28 Mar 2025 15:16:52 +0300 Gleb Popov wrote: > On Tue, Mar 25, 2025 at 8:27=E2=80=AFAM Gleb Popov w= rote: > > > > The high level code expects a descriptor with some properties, so we > > either provide it or have to patch large parts of the code using it. > > Emulating pidfd somehow is also fine to me, but I have no idea how to > > do that. libinotify-kqueue example shows that emulating a descriptor > > with certain properties is quite a non-trivial task. =20 >=20 > A bit orthogonal to the Capsicum discussion, I wonder if the following > idea makes sense: >=20 > We do have FUSE as a framework to implement filesystems from the > userspace, same goes for CUSE that allows for programming character > devices. Maybe having some sort of FDUSE providing a way to create > "custom" descriptors and define their behaviour from userspace would > be useful? And how do you imagine such an API ? --=20 WBR, @nuclight