From nobody Thu Mar 31 17:50:38 2022 X-Original-To: dev-commits-src-all@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 2F7BB1A56B66; Thu, 31 Mar 2022 17:50:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KTrSH3T3jz4rl1; Thu, 31 Mar 2022 17:50:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648749039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C3qs/YtAy5HysFIkhypQEr45YSemK+jjiHeIr0Ncivw=; b=lKUkLiUFLEGr82gduIB71o8lTuzHPbE+auNz2/WbzltlxBDL2Y9RRjkTPlyEd0Mk9YC2Hf nYNEkn1dJ+9ldy+Y+sPl1XJlleZOxBkn9DLbnk2vnBsvkLBaX4+mc+rGHs5uMXIk7NHa5t /fw3liWxjd+uXkxmh7CvybS1ohOxAQMfF8EeTfcKJPAzcvhiAzKAltAiB1BMJWSWfO6uH/ CWRyymUPNXksohA2BUbRPOCEQcOj4mjeKKlOOfNZBRSwkwz4Lu2ju++IKPJYDOSUw+cIB3 UHqSD+sqg8wzBjsJeRb9v/5NS1uAVQT+tox5i1XWGfzNy5l7rjn5yr/C51LrDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19A7D2C0D7; Thu, 31 Mar 2022 17:50:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22VHocju038673; Thu, 31 Mar 2022 17:50:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22VHocer038672; Thu, 31 Mar 2022 17:50:38 GMT (envelope-from git) Date: Thu, 31 Mar 2022 17:50:38 GMT Message-Id: <202203311750.22VHocer038672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: c7ef7c3facaf - main - linux(4): Add support for __WALL wait option bit. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7ef7c3facaf663c3da2d91916bcb2f162fc300e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648749039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C3qs/YtAy5HysFIkhypQEr45YSemK+jjiHeIr0Ncivw=; b=d6yjt4FxXtCQIROYXfz7r7bKyshek0HkJMF9w/+xZ1WsQm3trUIjjI3BBHgcnMdE3Dyr3D 4Z2hscAnA5vCpZwGA/KEtm1uPeOxRai8C8pLPXFmrdAAYU9U+DjvmzI7Fegu1I3bdn/V6z CZbiAuC9n8Qdqz3aL+FCijt1HMUCeO3rYbjDZSc4QbxUkkPCTIzchFf5DDcv5w8nGWRrPS RYXb6/ew4j5XMyzILft3pPs2giiwM5bBPWiet9CRKj6OENuhA1msYEokf5XM5Kc5TVY94T LBwkX5ia/4hd+gI9IGMnBWmkGCoTRxOgc3MEvaYRCpI6xbjA0LPLPjo53dx0Hg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648749039; a=rsa-sha256; cv=none; b=TB66MNQpDKeQQhvduo1E2+hjIdwieaDlIVt+8P6WCYbYDQ7W68SLn4EUXI9CRP8K+EYAU4 fClLK7UpueIl6pe4d+eG5UsQHMyZtE7hpJDMMv0dZiffc8YrmZX1ynb6jXB75p/mZjAU74 YK/o2PRQ9+AkPewLjgYafjoj0VGC6LCLwHXMP4Dj14kQVQ9UCAQbjPRifTlHnAxNo65OJ/ sk/RWCuclfzbj+rn4+N8UTNzbw2jKZQFgfi5ePufRtDMXz1txKSkbIDHDJse59vxLhare1 znHfMSjC2W8m72+2jz8s4QMEOz1L50jeWaLuFLutohVIrenjZpE+Cr7vKUGyOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c7ef7c3facaf663c3da2d91916bcb2f162fc300e commit c7ef7c3facaf663c3da2d91916bcb2f162fc300e Author: Dmitry Chagin AuthorDate: 2022-03-31 17:42:03 +0000 Commit: Dmitry Chagin CommitDate: 2022-03-31 17:42:03 +0000 linux(4): Add support for __WALL wait option bit. As FreeBSD does not have __WALL option bit analogue explicitly set all possible option bits to emulate Linux __WALL wait option bit. Reviewed by: emaste Differential revision: https://reviews.freebsd.org/D31555 MFC after: 2 weeks --- sys/compat/linux/linux_misc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index e2c231ed3460..6eae0fc01694 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1063,6 +1063,14 @@ linux_wait4(struct thread *td, struct linux_wait4_args *args) */ options |= WEXITED | WTRAPPED; + /* + * As FreeBSD does not have __WALL option bit analogue explicitly set all + * possible option bits to emulate Linux __WALL wait option bit. The same + * for waitid system call. + */ + if ((args->options & __WALL) != 0) + options |= WUNTRACED | WCONTINUED | WLINUXCLONE; + if (args->pid == WAIT_ANY) { idtype = P_ALL; id = 0; @@ -1096,6 +1104,9 @@ linux_waitid(struct thread *td, struct linux_waitid_args *args) options = 0; linux_to_bsd_waitopts(args->options, &options); + if ((args->options & __WALL) != 0) + options |= WEXITED | WTRAPPED | WUNTRACED | + WCONTINUED | WLINUXCLONE; switch (args->idtype) { case LINUX_P_ALL: