From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56E5AC433E0 for ; Fri, 22 May 2020 13:14:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CFF9206B6 for ; Fri, 22 May 2020 13:14:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729365AbgEVNOB (ORCPT ); Fri, 22 May 2020 09:14:01 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:35245 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729334AbgEVNOB (ORCPT ); Fri, 22 May 2020 09:14:01 -0400 Received: from ip5f5af183.dynamic.kabel-deutschland.de ([95.90.241.131] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jc7Uq-00072T-CU; Fri, 22 May 2020 13:13:56 +0000 Date: Fri, 22 May 2020 15:13:55 +0200 From: Christian Brauner To: Joel Fernandes Cc: LKML , Matthew Blecker , Jesse Barnes , Mike Frysinger , Christian Brauner , Vineeth Remanan Pillai , vineethrp@gmail.com, Peter Zijlstra , stable , Greg Kroah-Hartman Subject: Re: [PATCH RFC] sched/headers: Fix sched_setattr userspace compilation issues Message-ID: <20200522131355.f4bdc2f4h2zyqbku@wittgenstein> References: <20200521155346.168413-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Thu, May 21, 2020 at 11:55:21AM -0400, Joel Fernandes wrote: > On Thu, May 21, 2020 at 11:53 AM Joel Fernandes (Google) > wrote: > > > > On a modern Linux distro, compiling the following program fails: > > #include > > #include > > #include > > #include > > > > void main() { > > struct sched_attr sa; > > > > return; > > } > > > > with: > > /usr/include/linux/sched/types.h:8:8: \ > > error: redefinition of ‘struct sched_param’ > > 8 | struct sched_param { > > | ^~~~~~~~~~~ > > In file included from /usr/include/x86_64-linux-gnu/bits/sched.h:74, > > from /usr/include/sched.h:43, > > from /usr/include/pthread.h:23, > > from /tmp/s.c:4: > > /usr/include/x86_64-linux-gnu/bits/types/struct_sched_param.h:23:8: > > note: originally defined here > > 23 | struct sched_param > > | ^~~~~~~~~~~ > > > > This is also causing a problem on using sched_attr Chrome. The issue is > > sched_param is already provided by glibc. > > > > Guard the kernel's UAPI definition of sched_param with __KERNEL__ so > > that userspace can compile. > > > > Signed-off-by: Joel Fernandes (Google) > > If it is more preferable, another option is to move sched_param to > include/linux/sched/types.h Might it be worth Ccing libc-alpha here? Seems like one of those classic header conflicts. Christian