From patchwork Fri Oct 25 09:41:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13850350 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 77198D0C5F9 for ; Fri, 25 Oct 2024 09:42:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04BF36B00A2; Fri, 25 Oct 2024 05:42:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F16D36B00A3; Fri, 25 Oct 2024 05:42:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF40B6B00A4; Fri, 25 Oct 2024 05:42:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A93C26B00A2 for ; Fri, 25 Oct 2024 05:42:04 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 97426C06D7 for ; Fri, 25 Oct 2024 09:41:43 +0000 (UTC) X-FDA: 82711633116.02.78CC192 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf19.hostedemail.com (Postfix) with ESMTP id C44D01A0003 for ; Fri, 25 Oct 2024 09:41:36 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=WSgfrBWl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lOmlAua6; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1729849268; a=rsa-sha256; cv=pass; b=mDGVi6YoRzTEl21IMYh52gLMCmYJ4DcJ1JUHYwI8zz9h15mFDlve+t3vi+ehAgO8JKgosu rn/dJ176oUC0cF7VuICpZAnCi+WXnxkpK6BPygnjZ1+KYq1YGr3JJsMTVFPsXmBmD1yczW kTC2JarDDNQAd85SjzxZmwnf/08Li1g= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=WSgfrBWl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lOmlAua6; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@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=1729849268; 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=28E4OHRAaekZC0+GTng5ATugoUBni5IkfL5WtIyLXfGJNh7po/0WemWoe7uV85aqMRQ2Ck TW757mTn1/lPFubUcGuUBypcRuNGopj4tWOwyvOArxsOTjam6V1VeA2kmDUD4uNPd+Afd/ zo1rscMgpSh0ijuxhdW/VK42B5u4xPY= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49P8BZG8005832; Fri, 25 Oct 2024 09:41:54 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= WSgfrBWl2sYMqXQtdSQbn6UEGQgYeGnjRMU5BcojRJoGFuqZN+tJd+TEjOIp3bSg 1EeR2KfXaaFX/lYUJ0M0SNqaPhy3/ONpnvvezK/InH2ScaoxbPOeboKgLmTIEbjh jYc1dtMGyY4c8HqNxNztMdIF96KvtDwIJjvSwDGuTFCZIvgzQjrw0795nhhvpGJU KeSuBfwGHRNreSmzejFhwmQG+lIwk/PI37mi4w+5PpqnEwfn/X0jw6qBMdgbuH4x mFor1T9kpm0BRzFS8t5D89L4VmIQSQcOzr4qXwD4BgHN0wKLKHPYxkvNYFN8L5A0 woNkzTZzpzEMxqSVivXmcw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42c53uvk1s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Oct 2024 09:41:54 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49P8gDuV001662; Fri, 25 Oct 2024 09:41:53 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42g36a9y8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Oct 2024 09:41:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sgdSu4tmrR+arS06AgM0LNH4xmXpS5N176v1/USAhEMEWOC0TECj4FPB4VtZzS5otglr/gbwf2coBKAT61O1i1G6rxrSj/sWrB7EHn7IWXwLeGXv561LHVIqjNgi8ltdobXh2hSJoW4GrgI2yVCoYHRp1+vRT0BbZ5ZPRHrTSKlahEjMlrXmNpet9GFNGOx8hmlJtFbLaZBoHDHRhwKsceo0DQTeRPQa9d+wHYBRAyZFKVZbI74qLboNlVVyqh1vR1suGftDq+o/Qw2ADozS1I8npMX6LR/yDY7OsAAhcLldrD2J5jOxIgI8n4zgcxs1UkAdK0ORfazvRd3lp9gM2Q== 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=WDe6SEKNxCAKcbTmfSgrL90UKhlwXlvM7dn37XX4BEFgXNFLfndvPS0qzpBN/K9CON6OikUVo9WZC30uQZxv0ayfWT9cvny9RMlZhpgL6qaQlmNBxJHcTTdFifpn7ccfvUYCRuocoF+9T2sUWyRPBNb18qaS5UtfHyTc8LsDBOP1pSgrugNA4JMVTwDm/OF1ubkqm1JspKmxwaDxgiii+/kWhgWuk56oR7077vz0CZr/HFLtNsJHDLhXo1S+xmgTC7lbxp601kHOtqx6q3W2O264hCILRE7QHShXri/nHiicmGARTDKyzWqqhGKKZ4C+pItwfJWfGGxs8ODPae9bWg== 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=lOmlAua689kAFCthFnJWNizWEeAZerRgjwzW708mClNJFDTjs2HvHK0ofjo33GqdHBT9y9bsGyrZxhTszwQUSzhv86FuoSn8Ep2ThPNt6o092b1ZuXB77pVsFl3iTW6JZ+0puBEAc00F3BhgVhg6O0U03K4t917n6qOBXGu6qXQ= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by IA1PR10MB6121.namprd10.prod.outlook.com (2603:10b6:208:3ab::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Fri, 25 Oct 2024 09:41:50 +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; Fri, 25 Oct 2024 09:41:50 +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 v5 3/5] tools: testing: separate out wait_for_pid() into helper header Date: Fri, 25 Oct 2024 10:41:32 +0100 Message-ID: <391ca859c6e7c997647f43863a756808d368f8d4.1729848252.git.lorenzo.stoakes@oracle.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: X-ClientProxiedBy: LO2P265CA0377.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::29) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|IA1PR10MB6121:EE_ X-MS-Office365-Filtering-Correlation-Id: d184e8d2-3bee-4e55-bb7e-08dcf4d94062 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|366016|7416014|376014|1800799024; X-Microsoft-Antispam-Message-Info: dxET7Lb0S6TU4XQkkrk/7zZgq0wP/7shpYSDYGAzgVQ9EGCzucqBYzRur4W1Zmoq9IwtWz8waop5X0jYnxKu8aBH6dIUuu6l8ducp46sKkV6a+mwTbaGgg4fWzU6kWgBFakZ+pKEo1+XTBLVA9UPQtFruu/Jq/hCpu36NVsof6HcvsH8U7O6ReEWiqoQ4/RI77d0Aamxi2PYySu5FEsncm+gLPEGnW+f1yEMDUepzz7VlmT6mATV/GCwNYP35TiUnuB9XYMGXU/T+sdNcSAFyOlW+B3M/y17pKZVVYRTAfa0jcObg7xt+nXJd3mR7A3sKwMco/Fs/jw9yCF5IoNgTgmIDadjp6gIQXk0Mi6jjbW412dSxrDPwbm3zCqulUEJp3i2GOX72ATPtoVPKWtcZmFCxLdqEJ4e/WbdZXS6ZhJNpUqZ0XSpJWMkcm7SJCdvlELdbM7Gaoer4SWxN+QwJXBYgVZe9Ol3dfP8bU2NO9Dr57qSv3xfTWB9qd1H5IAN/NSJZhVP4eBOQw9nfbpm8uAKjtgNsWDGJiUPMe6pNlStvXyeLSISh6My43/xe59W/T5MY+faB645bAq6mGYUPphlVB9NyUhKfac8vll/bgRowusiBNeF1FIcvPQcDgCq/qALc8azaBtzQmGXUivON1imi5dT0mUZ7jgA69+FBMhWemBRo7QvtcKr7yjJwgS81/i5niirwhkzm6sLymvqKLhrwwP+O2NhAaqjWVcJgjcHiv/vTFupTuu1QIv+l87g8ikPfmeTUGXfzqPh7QclRGFTsAvDe5ZPBPeDKogERdfvRKqVEyZcpWjv1dwyV286RRVmkKdZn02O2KEGSAifCKD+IZOUuNZ066mRFAmpVEKufamxPe11OaB+QLhOT3XWZoxE+Br+rD7fJFk9huE6q0JX48dDlWJsPYFnem/QG4E81Emr0ywKOsD1fVSot9QhksKeJQwrjonObtH8X7FQhB5A6p0HA6yOAT+0AOWFqAIMADwiNntqqAESsND9BldXqxNX03H4vhne0PlgFotv2sTWln5bgehzdDGPyxrt3cIP7JPc64ctPnINtc5k5pUJ3ptLzdoWzehKApeocsq4n/Hogn8hAdveKYs5cMVMqyhZfKlYVz63JFxR6+fyvqbCmtYVrViaknhgE+cGU9+qJUOoYNoc2UhYdv6tO9dWkT+MudE/k+Kf5aX1WXoiTM/QoAiFsAD0KaPaiXyEJwiEgYqA8pkJsyfFqTbckmjzou626anjulnoQ2iasa/Z5EgAyTeaM++B/l4sihulWp0vPuAvOD8xyj2ZqrhcG4uGYjRThHthhtQ9Uzx0Bqqyr9tA 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)(10070799003)(366016)(7416014)(376014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QvM5UmjLoFG9y9JN4IoiZDV2BdJAL/U2mNSmNQOnvJ61vCZpTIC1X/npwTzBWhA2uDrL0VcHRYDEFU38f7xrG0Ghdq/pVbsYJVfA/mv2beX28tt5aaYSzDErSE8wnmaGQuxdF2eM04+YiLmJ9v9nrbWLJ5ZhOppUK/cAQDl3ZhWnRkVk8vlYaBb/F+XdsS/H+QZDspW7LrCl+BakVs6PD/j3GkgCP0o0pFK6I8QF51WRBeHsEs59haBsocsCNnsA5DTHG5CP/01ob9UNU5ZbMubVY/Q3AtwUSaHJFELbLVYq1euW8lPoSi5Fc14LYkqjgzVpdk26p5DNhgsk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p9yA/7nO2WQZVmNZtQHqOXHV1MxGswSVbOttQwWauKyIGwmJmqPAk5F4vYSkdabioznPB9x4MnJbdbBrE5CIUzLE4bT7yXJBTOOExA5fHddnu1GLKYacezAaksNihB+wJl+44wJR9dvqDB+/m7s6Q8KlAzwvqduM1Eu+EmHpOYnY7ORVTg3OViXEoEBBDPdZvgJvPbU/R8yuc410ze2llX2ErORN4rHCxQrJqsj2PL87fU7flMvVGgPUS3/19aqmhmlNrNISNnwsw36DZvjO2w== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: JMkO1U5gdOyjD6QZ7zFjQ2gwjmsz8AErz93tR5jpjD54jWFDCs7vcZeHKA1OBau4NFL6R+dBEsga0+TncgVgag0ia19uGtrwCQ5XMvK2ab1ZFNkt1AqXApaKbB8G3aO2jzIDPcgNekPdPMqWVAVlO6WRx9+cx+1qK1BfvAB9jZRB5CsA+eHFciDvSkeqYlfNf4hLoK03Rts47rQTUMbgRg0s7bEnVAsE0ZJNPQCdB8j6qUpSocshnyfGTh+T3tkDBm+9PjrtC7p7aXF4gII9gJTfYp7E8P8xe0DJsDN37JnNMi3CA4nP7dyOVcK60ei5uHPDooe4J7bN+qpJi4tK/ZDteq6HO8TcR3+YgUqzsDmxD4+5I6rbr18mpLm0XHbWFPNALbLFbze+QXvcJ0Iiq76L+dosIr3DyQeJmxqM0D4/7zFa/TeOmbA32G031cjIkuga61gAf/eXbGwMmdSs5hOG5GZ23K4TGZ2zAJoJYGOyVsnyzWCAquh1peCgBOgZNrV4DjWX3A/tDNuSsKbsZ5h7knLjRk8dLIbK1vthVyZhNSaH7WN74PNXkyJz8bN9bgilvaJm/1QjUJ0jSo+rIYDQfAk4JNUiUdfvAcv7bWg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d184e8d2-3bee-4e55-bb7e-08dcf4d94062 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2024 09:41:50.7860 (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: Y+btAPDiwaR5mDz6CRXHVCoH4FYmleoiRobOEE14ntl80tKgS3OBzsZG8+d7K2X+Nn2eDezDa2mxNJGxfwdcGLGZ2LvRCyokUvo9RKw7hac= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB6121 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_06,2024-10-25_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410250073 X-Proofpoint-GUID: 5FgkEX0XTqnEDSHi1T4J8rYwtS3ykv-L X-Proofpoint-ORIG-GUID: 5FgkEX0XTqnEDSHi1T4J8rYwtS3ykv-L X-Rspam-User: X-Rspamd-Queue-Id: C44D01A0003 X-Rspamd-Server: rspam01 X-Stat-Signature: q8rix6wnyapeapmz61ohz5q1toxkc6y4 X-HE-Tag: 1729849296-957243 X-HE-Meta: U2FsdGVkX1+iXby3YtJstzcWBJHmrH3iupE5xqqCQHz+ctSJcW2GoKeIWmDAvNrHfhndaMBmnXo9tiuKhOVQIDcyJTlI3u2hx6FaqlvAS0813D8GgVITtjjAlfvd0RwPzZKuat/MxD2bWkAlfKd0EkiCeqIvhj7zH7gqUndWb2AhRUSRg/yy1UqXDugs6SLL4OsjVIQXUbJ+uK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dJegq/Ht7vOqffpj4+gUbAWENWSXe+bLuWMARgTv4OuUoA5OGJc/wFd1Z/0BxOVKV7orKUCfy+Z5B9Z+wMWive84h93hKtI3T3zFOjtWTBUa8Gu5rBek0axEBTHWz+mhZiNOs1hixP+tquUAa3WK3Fi5DXmRRwPdAyOpa7cimI/nQaHl03vaMHHiZe/iaYkH7JhWkh7RSo+HLTghm9YGclWUf9Nfk31uhurnp+x0wp+EBMlYxgdAr5Ot56+/hOnW7qcQ3i9+Nxl1dsaZ1Ba3fnxgMECDZk1c9LXwKCqY/hDbuEv87O+Qfgtwo01kfnA/GNrXq1hvr7fUBieS8E5x+yDI/kE43EA2aFnEsOmLye8M+kqPWyfwfcriGF4cS0nD73iTfJ5IgMhGI6+cYQ= 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 */