From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 682BB246F4 for ; Mon, 3 Jun 2024 01:05:40 +0200 (CEST) Received: (qmail 28408 invoked by uid 550); 2 Jun 2024 23:05:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 28361 invoked from network); 2 Jun 2024 23:05:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1717369528; x=1717974328; darn=lists.openwall.com; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=zOnkiuqIN9r2A5UgbY1iBOjAtQr8MQXnWSQ2OA9fFp0=; b=m+P33oIaglwi+NgMW/X3fgHI19+s/ysYc7czBinJe1NnamzQ8fvBM3MaOyIvrF6HlI wa+JgPlV/DF094cpxc6287xbmuARwxd+l4sAfaR6uuOZqs3rO2DG3l7eLnOZSKPNIX7Q SK6fIiL0pIH/zjPNst5h+0AxfeuMokVoS7+PM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717369528; x=1717974328; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zOnkiuqIN9r2A5UgbY1iBOjAtQr8MQXnWSQ2OA9fFp0=; b=ARbqh+Jt2s7QeUbGXdQhCpbyHMXSu93Hk4d1K12q50JZH+3p+63ibhbkD6YuLa3Xmh hdcHx1ZkQyX+YnUM4GT6bXLEDJh+/OgHxNiiNeYyV6640lcjCucEjRvuQaiItmkt/tTu d8pZAcrK/LifetjkkFNqO0b1uZwnwMMaTF6Frn7FECmsGIdXSKKFU7EhO2QihC30f/Iu h0ZKkRmgSv+Kwx33BSckKCTq3Ef/5Ssxf/5hJOzD9US79AqbLMZHMPcos3663chm9//X uE5T40jIs8kJV47awMySmFQlg2WiBX8THyzhmQDj/vMM/zEHjtGsxInsgRn8INk6XKo3 lEWQ== X-Gm-Message-State: AOJu0Yw3+4erXjseJ/DMU0pdfb9Z1CdfYMRtAO5VYcaC3d+kCHCm/wuQ Gw0yJ+XKKs2sN/6FWhENZWs6KwUXo7ixWd7YZew+9I+BiCxe0ueW88gbr/9tIuM= X-Google-Smtp-Source: AGHT+IFjcXYITLbu6Pp6oT5TKVRoxQxYBx4gYpKF9b4Su2F+rAyHh97xjtlkieE7daA/1WOL3bYAVw== X-Received: by 2002:a05:6a00:1a91:b0:702:325e:ae57 with SMTP id d2e1a72fcca58-702477bbc69mr8147840b3a.5.1717369527566; Sun, 02 Jun 2024 16:05:27 -0700 (PDT) Date: Sun, 2 Jun 2024 16:05:25 -0700 From: Joe Damato To: Rich Felker Cc: musl@lists.openwall.com Message-ID: References: <20240529064959.1733708-1-jdamato@fastly.com> <20240529131707.GI10433@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [musl] [PATCH] sys/epoll.h: add epoll ioctls On Wed, May 29, 2024 at 08:11:13AM -0700, Joe Damato wrote: > On Wed, May 29, 2024 at 09:17:07AM -0400, Rich Felker wrote: > > On Wed, May 29, 2024 at 06:49:59AM +0000, Joe Damato wrote: > > > add two ioctls to get and set struct epoll_params to allow users to > > > control epoll based busy polling of network sockets. > > > > > > added to uapi in commit 18e2bf0edf4dd88d9656ec92395aa47392e85b61 (Linux > > > kernel 6.9 and newer). > > > --- > > > include/sys/epoll.h | 12 ++++++++++++ > > > 1 file changed, 12 insertions(+) > > > > > > diff --git a/include/sys/epoll.h b/include/sys/epoll.h > > > index ac81a841..5f975c4a 100644 > > > --- a/include/sys/epoll.h > > > +++ b/include/sys/epoll.h > > > @@ -7,6 +7,7 @@ extern "C" { > > > > > > #include > > > #include > > > +#include > > > #include > > > > > > #define __NEED_sigset_t > > > @@ -54,6 +55,17 @@ __attribute__ ((__packed__)) > > > #endif > > > ; > > > > > > +struct epoll_params { > > > + uint32_t busy_poll_usecs; > > > + uint16_t busy_poll_budget; > > > + uint8_t prefer_busy_poll; > > > + > > > + uint8_t __pad; > > > +}; > > > + > > > +#define EPOLL_IOC_TYPE 0x8A > > > +#define EPIOCSPARAMS _IOW(EPOLL_IOC_TYPE, 0x01, struct epoll_params) > > > +#define EPIOCGPARAMS _IOR(EPOLL_IOC_TYPE, 0x02, struct epoll_params) > > > > > > int epoll_create(int); > > > int epoll_create1(int); > > > -- > > > 2.34.1 > > > > This is probably okay, but we should at least ask if sys/ioctl.h is > > going to be a namespace mess. Is the intent to bring all of it in, or > > just to get the EPIOC* macros which depend on _IOW and _IOR? > > Yes, sys/ioctl.h is pulled in for the _IOW and _IOR macros. > Similar to, for example, sys/mtio.h in musl, which also pulls in > sys/ioctl.h. > > > On glibc, does it pull in sys/ioctl.h? > > Yes, the code I've submit for glibc does pull in sys/ioctl.h. > > That code has been approved by a glibc committer, but not yet merged > to the tree (I assume that will happen in a few days): > > https://sourceware.org/pipermail/libc-alpha/2024-May/157166.html Just wanted to follow up on the above. Were you expecting me to make any changes or did you want to wait until libc takes the code before accepting it? FWIW: uclibc has taken the patch here: https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=8bb33a2e1f2baec2078581d77e181f1ead5f51aa And musl has similar code in include/sys/mount.h: https://git.musl-libc.org/cgit/musl/tree/include/sys/mount.h#n8 Thanks, Joe