From nobody Tue Aug 30 16:24:55 2022 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 4MHCMQ4jh0z4ZqNh for ; Tue, 30 Aug 2022 16:25:06 +0000 (UTC) (envelope-from jake@technologyfriends.net) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (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 4MHCMP3PZnz44pR for ; Tue, 30 Aug 2022 16:25:05 +0000 (UTC) (envelope-from jake@technologyfriends.net) Received: by mail-qk1-x731.google.com with SMTP id j6so8795888qkl.10 for ; Tue, 30 Aug 2022 09:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=technologyfriends.net; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=myb0aelF5nn13Om80UM9y4QxQGWxQO+DlRJEqQ22+EI=; b=hP0M6CDrCChQKLHiPkGwXhgA/CL20jaPpRGopa1T7YFonfjC43hdeWkzfy0S+pF3O+ hnSZZyJuBcHcHydeLYiSb2o4b/C21wNU4iYwRo+0jvn0GZZjvOjDXXkaHHVAwQ9vaF4c xSf0DI7Z7MKcsjRTVd3yzChQ4ICmRzXNDOa/AbUJ3/noVtvcwJfKPmu5HOvSl0WyCzeg p4CUNxXzoS4n5RqBrr8Gqftw48urkcSTyWxAb9LrJ/yaFAn4UzcVHC0/mFNhNyxSs9XU QvdiE3vtoK80RQJ6zqmMCAs540XZXC4PgdaAHsiVuPXZkqMAPukRFXAWDk7N+U+s7sy6 Rrrw== 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:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=myb0aelF5nn13Om80UM9y4QxQGWxQO+DlRJEqQ22+EI=; b=tSq4jXxJZ3om9R/EvtKeRqE0QrI94o68B/DRggCpB6JWJ9zz+mt/YOaS9DnBwYfbAo T4IVvmUV9FXxhKfdr6vub32IXpRZA/1JmfMcjgIYyKZowp2bquLnoZhyq6M1QmBqQIIX QyzoRUi1+3w8uVBKnOaE5zkZ8kaBLAFQYW2QD0JfjjqSZIbZruV4Z3gQINag/82EOf8G Kk4kd3BiHm6GnIOG5wXuyCqzuxqrLglSyty4Qxe3quO+6lVdWuAMLRspyd/8jVOuLqOR 00DxgEc2T/OotmbKUEfjlyn4j2FCPlvosJFl+G34hB23PZUSyvMdru/v4n8M4GyEcx/2 pIDw== X-Gm-Message-State: ACgBeo1yZbVdAHSGnW8AlRacwMF/PVzAqbIi22XVvhqN7kAlyaeJoGyG Jwz0SFtzApV0WEU1In0omygZHuoF5Vs7orTp9hUH8Q== X-Google-Smtp-Source: AA6agR4Algvx0Js5RVv1aquYvpzn39SJpXrD/k1PAGrS5muba1ud8AoRuaE6J7syhNXVWSMo7ANgb/f5NsPwBFmezVk= X-Received: by 2002:a05:620a:25c8:b0:6ae:bf82:8f36 with SMTP id y8-20020a05620a25c800b006aebf828f36mr13039441qko.354.1661876703879; Tue, 30 Aug 2022 09:25:03 -0700 (PDT) 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 References: <20220829203947.GB89898@spindle.one-eyed-alien.net> In-Reply-To: <20220829203947.GB89898@spindle.one-eyed-alien.net> From: Jake Freeland Date: Tue, 30 Aug 2022 11:24:55 -0500 Message-ID: Subject: Re: SRC Contributions: Advice and Objections To: Brooks Davis Cc: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009876e705e777d2aa" X-Rspamd-Queue-Id: 4MHCMP3PZnz44pR X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none ("invalid DKIM record") header.d=technologyfriends.net header.s=google header.b=hP0M6CDr; dmarc=none; spf=none (mx1.freebsd.org: domain of jake@technologyfriends.net has no SPF policy when checking 2607:f8b0:4864:20::731) smtp.mailfrom=jake@technologyfriends.net X-Spamd-Result: default: False [-3.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_PERMFAIL(0.00)[technologyfriends.net:s=google]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::731:from]; DKIM_TRACE(0.00)[technologyfriends.net:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[jake]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[technologyfriends.net]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --0000000000009876e705e777d2aa Content-Type: text/plain; charset="UTF-8" Brooks, Thank you for the response. I did not know there was a pre-existing LinuxKPI timerfd implementation. I will surely use that as reference for building the native FreeBSD version. The %m format specifier is not incredibly important for my work, but I thought it would be nice to have in FreeBSD's libc. Has there been discussion about deprecating %m from POSIX in the past? Jake Freeland On Mon, Aug 29, 2022 at 3:39 PM Brooks Davis wrote: > On Mon, Aug 29, 2022 at 03:17:51PM -0500, Jake Freeland wrote: > > * Implementing timerfd: > > https://man7.org/linux/man-pages/man2/timerfd_gettime.2.html > > I am unsure whether it would be beneficial to upstream POSIX timer > > patches for igt-gpu-tools or to implement timerfd for FreeBSD. I am > > erring on the side of implementing timerfd if other applications need > > to use it in the future. > > This might be a good place to start on kernel work because we already > have an implementation for linux compat. You'd need to move the > implementation into sys/kern and add manpages, syscall, and libc > wrappers. IMO this is a good idea vs using a wrapper epoll-shim because > it allows better support for timers in capability mode. > > > * Adding %m format specifier to scanf: > > The %m format specifier is a POSIX extension to the ISO C standard that > can > > precede > > %c, %s, and %[. The %m allocates a memory buffer to hold the string > > including a > > terminating null character. > > This seems reasonable (unless there's a move afoot to deprecate this in > a future POSIX, but I don't think I've seen traffic to that effect.) > > -- Brooks > --0000000000009876e705e777d2aa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Brooks,

Thank you for the response. I d= id not know there was a pre-existing LinuxKPI
timerfd implementat= ion. I will surely use that as reference for building the native
= FreeBSD version. The %m format specifier is not incredibly important for my= work,
but I thought it would be nice to have in FreeBSD's li= bc. Has there been discussion
about deprecating %m from POSIX in = the past?

Jake Freeland

On Mon, Aug 29, 2022= at 3:39 PM Brooks Davis <brooks@f= reebsd.org> wrote:
On Mon, Aug 29, 2022 at 03:17:51PM -0500, Jake Freeland wrote: > * Implementing timerfd:
> https://man7.org/linux/man-pages/ma= n2/timerfd_gettime.2.html
> I am unsure whether it would be beneficial to upstream POSIX timer
> patches for igt-gpu-tools or to implement timerfd for FreeBSD. I am > erring on the side of implementing timerfd if other applications need<= br> > to use it in the future.

This might be a good place to start on kernel work because we already
have an implementation for linux compat.=C2=A0 You'd need to move the implementation into sys/kern and add manpages, syscall, and libc
wrappers.=C2=A0 IMO this is a good idea vs using a wrapper epoll-shim becau= se
it allows better support for timers in capability mode.

> * Adding %m format specifier to scanf:
> The %m format specifier is a POSIX extension to the ISO C standard tha= t can
> precede
> %c, %s, and %[. The %m allocates a memory buffer to hold the string > including a
> terminating null character.

This seems reasonable (unless there's a move afoot to deprecate this in=
a future POSIX, but I don't think I've seen traffic to that effect.= )

-- Brooks
--0000000000009876e705e777d2aa--