From patchwork Sat Oct 26 07:24:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13852103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4B31D10BE8 for ; Sat, 26 Oct 2024 07:25:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 57AA16B0088; Sat, 26 Oct 2024 03:25:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 504386B0089; Sat, 26 Oct 2024 03:25:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BAEF6B008A; Sat, 26 Oct 2024 03:25:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id F26DB6B0088 for ; Sat, 26 Oct 2024 03:25:33 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id CBF09C037B for ; Sat, 26 Oct 2024 07:25:11 +0000 (UTC) X-FDA: 82714916760.17.E206A88 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 422074001A for ; Sat, 26 Oct 2024 07:25:05 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="PWuAKu/5"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MNcY7ilh; spf=pass (imf11.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729927452; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SLlbDZlZ3nLzA+OMshfpAja8xZBB1l8GJOD6tbMQ7pA=; b=VI86/RnPYnRa1IzdX0S4cm4xGZlg2Ne/ZDMi/TxDXdhesl+/VlAXItfyYbptHJ4aDlcdFa O7B6fHnAsfrugTGR+I4J8LHdPqzBYtZbLXJRBxQkisL1LvIdnUTJ9kMsD0kCosblRrv1pL PeSYFYriPbVRxdEWDqKc7LvpXWowgE0= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="PWuAKu/5"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=MNcY7ilh; spf=pass (imf11.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1729927452; a=rsa-sha256; cv=pass; b=57+ocxQlhx9k9iCBcm/E6TvwadBKskD58Qo9zfNDsBZmijpceFf46PhJwlQERsrOu0f/xz 8CqAArzDf4H8V9Bz2f181vGwReib5ACrZi+WbEnR4swCqIEQMvtf/HUwmztABR+7Mh4yRI 4ZCjXkz5ly2J/dFzONFb2+5vfaF+2tw= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49Q3G69V024667; Sat, 26 Oct 2024 07:25:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=SLlbDZlZ3nLzA+OMshfpAja8xZBB1l8GJOD6tbMQ7pA=; b= PWuAKu/5Lk8XFEOjSH8gp0D/U+y2LRPkZ8K2PDwW6OkApIxNxqq3Q9aQYh6nb+bM 5k70SiOh/qSq9M24x3ERBUaR0HZEjul3qKOQCQ7eZY9PEP8ICc3MKUzKfth3ma9u lcs/o9BHtuMy5tTDpSZB6WQHqsAi5Ul3e4h6kWyLaAkdNn1cDTYBq9BmtDC4zttl Yg3pUbkjAhM4PHx9QpIKlislD/t6YSnvTvVTGog+7DcRUcq/yB3EH5ZJq7LVfRfg TTtKGZue8eGV0yz8majGCRe3r+B1JEPCszO+qOW288/Cch34GMAZiAwVKPBkJU4m aJDalVgOSezW4OfKHtCdFA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grc8r4qv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 26 Oct 2024 07:25:20 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49Q3Duxv031966; Sat, 26 Oct 2024 07:25:19 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2044.outbound.protection.outlook.com [104.47.70.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42gpv44tug-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 26 Oct 2024 07:25:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cY+WVuFezljjN0sms6nRYNy7HGp+P6eP6yMT5Hkr6V8A2gDddSyXBIiASTDVzz0U0OUtwZEDJEdSYLF8T4W80pJXWaGynl7PoiKY0DWx7ZlrcrpnxZYr3Q3eo3M3Pt37hD4o08cqDpSFW81UtYHjhR1WzZzfObk3/FBohxBx21faM6UhaKcnX79KGGmspUpBeHO4821PZg+Zk5eJj62NDqLr4Hida1dMW+ZviODMhB9jSpsKqeMODxkIL43OUXBN5vjVZ8fdjmkPCPevjOurWDaAbW2qCHEOQSx6Xr+lLY/mnmJe61kBGu1L1r778D6N1R/eVxxU1oVq7SPwp3lY5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SLlbDZlZ3nLzA+OMshfpAja8xZBB1l8GJOD6tbMQ7pA=; b=U9RtpMbmm9ps1nmKQwWlWQMjlKW5C0qTinMzSSzvMwYC6UOogSq/ujhBFkC+abEkIuWpviwzNC9bJLBBUJxdBxZLtKwq1USBXoSM5WYhUDJ1OwDGeCXfsiW6nIyCytLG4R56aIBkobbiVIICoKf5rOp0/0jjkgJyXFVifcu9dUA/zAHCceQm1EAGuVXhTepXxIV5PRBiXdHxIJ/kj5W1ZP5tg8MuOG+VfVeiPOn2pUZj+CTOHl8kQiNIedUhRsR4bKeHgKDnZvNbufyQnCO8e/ZWjNHY11MZcQ2f7mVjr9+dv4t7Q2qp1cDImhvBqblZDoyvUf4jmhE2mymXERBIiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SLlbDZlZ3nLzA+OMshfpAja8xZBB1l8GJOD6tbMQ7pA=; b=MNcY7ilhVVvwPC0YoKlr+IW6RQETezAZ08TCkRA6IyYSbAQLFqVg8RrM51eUaA6cWo6ZTQ+e2I5vk77KXCH7XZhkGDBRv9ekbVktYNgyMqD7GQzCiCtjC/zzmp0hE3KOCVYaSTiHJ4uEnj6x6wJ7pwEUKRzyqYyXqMdyYrKNLpU= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by SJ0PR10MB4543.namprd10.prod.outlook.com (2603:10b6:a03:2d9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.23; Sat, 26 Oct 2024 07:25:17 +0000 Received: from BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9]) by BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9%6]) with mapi id 15.20.8093.014; Sat, 26 Oct 2024 07:25:17 +0000 From: Lorenzo Stoakes To: Christian Brauner Cc: Shuah Khan , "Liam R . Howlett" , Suren Baghdasaryan , Vlastimil Babka , pedro.falcato@gmail.com, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Oliver Sang , John Hubbard Subject: [PATCH v6 3/5] tools: testing: separate out wait_for_pid() into helper header Date: Sat, 26 Oct 2024 08:24:59 +0100 Message-ID: <334ba78c4a6f4e58c60634709df26debf4b4de29.1729926229.git.lorenzo.stoakes@oracle.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: X-ClientProxiedBy: LO2P265CA0389.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:f::17) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|SJ0PR10MB4543:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f2d9740-534d-4abd-70f6-08dcf58f56fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|1800799024; X-Microsoft-Antispam-Message-Info: eY20M5syZkPI+27aKfC1RLMwz6h6tBaY6PEIU1ANwk4Afwhkb8VUxiJhCBI0mN/1Kj4uw7tMMqC9dvaHUYWvp8tZacxlCvrhMoh7qGh7Rxk4zLpIhgAhoA+9QUenE/b6wt9FIGfLDISQ3zIz6DOKBoGUef6gmCuTM3xpGNT4coqk1n0lKxWFZP4CnwmbhP+9nEngX4Umm9sPD15A3HATM4H9iKLlKpnBp8mhKWoA66X8CRPkZhd+gY/Ne7PWF8plmXrFGgkDa2F2i6jdpys9UXOqVN6Df+xrW/w425qbRiEBGePS1kOsQ7jM+Iac7h3gfabvT0uNGZRCpR26bDqj7XnIr0cpVGHXoT6wVKXkERrN924t4n7C28vZn8wXFVHcFuDs/wxte5lMPMx2QuBZ7eUpBGWD9FnIYuywSs/dQbQ3SrG8N0x8RNLIo+GxbdWd0m4nxRrO8RYh7yBvcR2MGHmAXyHOlojo40Rou/W+rXDy/IK/OMoUxc+6nv7Y+VivD1kqYcejcgdxNlUzl5KEMPrz3og4mqUh0urVeMj5vqa9epld/begNms9sETIvdPiRWabS+9xM2H7LdPk7Q+ZC1QeOifNrjCOuqYMnlEG91g4krxBURyXUK+5FBjzrDwjoFuF/bsVvAxLW0/NRPDtDlZhSgLJ2h6QgQ/st+fHRjqLThHf0BHVIImHUCAQRSHrucu91oIePNJJ6ekjNi9cgnvpdNH2arjkrvoUo/za7SU1rlYzJivBZBegDDhrDJqoSf9+zb1FhAJNDk7hbNNE7UmJT1xxtqwfycP/ZNC5ypwAN30Gr82uvkeLcbrdWx6krLOdq6aWaRRQIOqbxf/GyO8bj3wX82rLdWBmDOV2PbBQimKRnUSeTyKFEwyp5DeIS1YxUXqdiPfqvumN8IS2Q1w7AIFfVZbmAPp7hAYrl3NoS3ygbJtaAH22voU4lDJOfh1my9IVhT8i5m4Euva7JDnoyQtp+5LVEGf9NPzoE9O9oF6UCEuHzBZazswHtlJjPs8Sx7Jg6JJQ2BZcKXTqsuP1De7HQrEpnRekSh64v/RXG6bRZ0I44YeZqa6swYv4d+lAxWddOrTYEU3tSPx6Sl7TduCvuztWMnUa/7vkqiW53skSz9dvhatSrkFcgoWnUKNsXLd5QbW+nJDdOgE08y6o9zV/ahCdG8XOM0kc2Xw20KyWP5M2L39QMD0MQkAdHSVQ1AzJ6JTrd6cRTKps/W/d6+pNuTQ8bVxTayL64yd8vs1cQgAprpw22oySJuJ6a4N0tJ5rKKVWZjrms0e3I1jVigAyUcXoIb84BXYvyYTtLUpSNyQ/1vop4xJ8tps0 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3366.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eCVE5teT6+iRCX4ywqzriyflKQEcCZ7c3gb/Y/eKdgVTg7ocrBzj7QG8o9bFlIiwrpPtCi6K/lM8vPq8xGwpGJnW8wP7s68lZTE2rsFFA5Ffwob0c7jJFfYqbCXS57zJ8dTsLHIH1INirNTlPWwICMCgP0VxVkaA5RL3ilv5N1X2AtI4Q8K04Ta71jHzjh6QFKoegAo27QV6jvIc12kfmUQ4D9WLEbgDNF3d9QbYA0NSOoyhC/wQsCpColL58KfdYJAeFGjBIp7G4iFbgG5pqrUh/xutxH60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8LRdLyL2RJlrcdH7Ae47POEGc07smoTn0QPjyoI4Bp/ry6hLZmr1DC6UZWh904s9UQSabxTFTld5gF+rQ9x5ZN6F8vbqrpaxzPsU2MvsMq3XnoNe5Sd+YQQL16Quj5BtS8fsrymMvZOcDYf/JlIz1ZmhVjlZ4W7t9VATE+VfvSCVPBecqbEnaB4UDeec5UR6Uz03TIkwcqsK7vL1TG/Hz9tYP7O+saEQHMX/YQxaqNkjLpB/9qg2UCpk8a7Q== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: HK2Kbpu2+XCjwz6YiZa7I2F4RHB8xJ2k2uNtnP1VLuOVtHsoKLnoOLvfSFQ7GjKENSv+j24rxoDkXhyJ3jzn21+un/zSKaFTLi2LHAoKdRTP7RwoRGkkEtaxznTu7TakH4Ljn4wyq+XzwbJrPBrwdQImxoLItDsFexVjrVbLGPSpVIBWN+VrTiKUlbghrN8BIXibFzZCElUcYjZdVFMAOXYZ9+D8UEKZd//dTnc94dWwR3acGekWGy+rBYe4xdyvHG5oc7oVuvEjjCkaVK7+6cGP2jajHNp21ONtD7/L+l3PHts5+/C4ByJq//hdIsuJ2SRuIguVWhCBv7RlnD+DsdHgEqmlNRDaRfGGImhqZiq2lGYSCN9pujrzLFCiWnQ5k6vn7e5VkQ/u3ogV84X0JvkJbVXWvGYsUJ58gWOv2zDp/xxQozXGHx97Bmj/8UAwrymIL10oTOW5E3wNUj2Jez7BtJfjxnpfQZHi+jIJlShD0MFQQzRaSTy0bvzvDpGMXmxDeTXodbwsaoUV1puCfFA8E6nnAEb+ZkcNnN/QZYyX8rp2XDc+DDMXFmWf3o4fxeLaCGwC4rArDQLjL8tp4zftlTQqzyGUFsYAYfoZBb8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f2d9740-534d-4abd-70f6-08dcf58f56fb X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2024 07:25:17.0290 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LsARB6aulFmDebW5ZA/IqmfWfJF0kX0UP7psNSmXlqREAGoMv22sQVjOue3r66Yghtwf8JA5tDl9cV8+FuahN8MKUJXTpqxooysZb/wRrzg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4543 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-25_14,2024-10-25_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410260060 X-Proofpoint-GUID: 0jM3AnRQHFUG9kVm2YZz7Pi2VNggFJyV X-Proofpoint-ORIG-GUID: 0jM3AnRQHFUG9kVm2YZz7Pi2VNggFJyV X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 422074001A X-Stat-Signature: heg87nzdjn3b6qru9tm4dyh5zyx7y5nn X-HE-Tag: 1729927505-721046 X-HE-Meta: U2FsdGVkX18e0wjQi1iU4bLWILUNBpdBS5iGfpPqVRZXGtV67cIpYoF20VSMtr1DS/CNYKHrjDS4uwb1zjihTGhHkSaHj9DKR+Gj3xmPEkwdJLOFEqRd5UpkC9z6v51QWeaUPJNB5szmT7e/e2pKj1ygN/IUrc6UpEj05gZDdVboOoZcd1oEF6Pc0PksWz1q7gLVP9ioeFKSsHSD9/y6cUncbms8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E85HV7Sz1Di6GgJlMxm+3/6gYZDSkn1Ocql6eTqDzYw6veDoaJef+89V4D6KNI0F/42gKyLAJv7JsG28QYFfix+gyQxb7aK6B1ot12jM8WUnH/32uv9f2sLwbCzUCzMcI7yygzmJgSH8pqnb4xPt3pRmtTolKG9oEfghcSGm6m9+KfbAipXUCAKsdsCmQrEqIeqvyN4IV2+EVeMLT/sP9VowY+diJ8qK3RRmZln0FnNkw+bQfbR+Eh1Jvpyv9j/V2KNd0TchC+D8Sj4ForUt1xUH38/RMqXQp54MuUrVYXnUzpx16D4o2234vWhsNoBri99eRPuDvOqRn8GIsPVGR2kRZbnp7L6tEBd+tsgrMYOseviD6iIDLWk4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: It seems tests other than the pidfd tests use the wait_for_pid() function declared in pidfd.h. Since we will shortly be modifying pidfd.h in a way that might clash with other tests, separate this out and update tests accordingly. Signed-off-by: Lorenzo Stoakes --- tools/testing/selftests/cgroup/test_kill.c | 2 +- .../pid_namespace/regression_enomem.c | 2 +- tools/testing/selftests/pidfd/pidfd.h | 26 +------------ tools/testing/selftests/pidfd/pidfd_helpers.h | 39 +++++++++++++++++++ 4 files changed, 42 insertions(+), 27 deletions(-) create mode 100644 tools/testing/selftests/pidfd/pidfd_helpers.h diff --git a/tools/testing/selftests/cgroup/test_kill.c b/tools/testing/selftests/cgroup/test_kill.c index 0e5bb6c7307a..2367f645fe89 100644 --- a/tools/testing/selftests/cgroup/test_kill.c +++ b/tools/testing/selftests/cgroup/test_kill.c @@ -10,7 +10,7 @@ #include #include "../kselftest.h" -#include "../pidfd/pidfd.h" +#include "../pidfd/pidfd_helpers.h" #include "cgroup_util.h" /* diff --git a/tools/testing/selftests/pid_namespace/regression_enomem.c b/tools/testing/selftests/pid_namespace/regression_enomem.c index 7d84097ad45c..f3e6989c8069 100644 --- a/tools/testing/selftests/pid_namespace/regression_enomem.c +++ b/tools/testing/selftests/pid_namespace/regression_enomem.c @@ -12,7 +12,7 @@ #include #include "../kselftest_harness.h" -#include "../pidfd/pidfd.h" +#include "../pidfd/pidfd_helpers.h" /* * Regression test for: diff --git a/tools/testing/selftests/pidfd/pidfd.h b/tools/testing/selftests/pidfd/pidfd.h index 88d6830ee004..0f3fc51cec73 100644 --- a/tools/testing/selftests/pidfd/pidfd.h +++ b/tools/testing/selftests/pidfd/pidfd.h @@ -17,6 +17,7 @@ #include #include "../kselftest.h" +#include "pidfd_helpers.h" #ifndef P_PIDFD #define P_PIDFD 3 @@ -68,31 +69,6 @@ #define PIDFD_SKIP 3 #define PIDFD_XFAIL 4 -static inline int wait_for_pid(pid_t pid) -{ - int status, ret; - -again: - ret = waitpid(pid, &status, 0); - if (ret == -1) { - if (errno == EINTR) - goto again; - - ksft_print_msg("waitpid returned -1, errno=%d\n", errno); - return -1; - } - - if (!WIFEXITED(status)) { - ksft_print_msg( - "waitpid !WIFEXITED, WIFSIGNALED=%d, WTERMSIG=%d\n", - WIFSIGNALED(status), WTERMSIG(status)); - return -1; - } - - ret = WEXITSTATUS(status); - return ret; -} - static inline int sys_pidfd_open(pid_t pid, unsigned int flags) { return syscall(__NR_pidfd_open, pid, flags); diff --git a/tools/testing/selftests/pidfd/pidfd_helpers.h b/tools/testing/selftests/pidfd/pidfd_helpers.h new file mode 100644 index 000000000000..5637bfe888de --- /dev/null +++ b/tools/testing/selftests/pidfd/pidfd_helpers.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __PIDFD_HELPERS_H +#define __PIDFD_HELPERS_H + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include "../kselftest.h" + +static inline int wait_for_pid(pid_t pid) +{ + int status, ret; + +again: + ret = waitpid(pid, &status, 0); + if (ret == -1) { + if (errno == EINTR) + goto again; + + ksft_print_msg("waitpid returned -1, errno=%d\n", errno); + return -1; + } + + if (!WIFEXITED(status)) { + ksft_print_msg( + "waitpid !WIFEXITED, WIFSIGNALED=%d, WTERMSIG=%d\n", + WIFSIGNALED(status), WTERMSIG(status)); + return -1; + } + + ret = WEXITSTATUS(status); + return ret; +} + +#endif /* __PIDFD_HELPERS_H */