From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E7B573858CDA; Mon, 26 Sep 2022 11:14:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7B573858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664190841; bh=FFa9UaKFDgkTIp1+6lpRqAtUsxISpIm5yamU5IRLGIA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HfzsAh/nbr/RS2YlR3CMzlfL4beF+jDzAMrcAAGY6rh/QZHB2nhxyMxiaZgfIyWtB vmKP8l5OoIxrjM9soo0SvTjAh6gIKFqx9kWSDxWxtZIp0A+esNqU9Zj3UX5YIsyLfo sXAHQzPhUnCXZ8QTEmX/4Dv2FkoXiXV2iqaY42ZE= From: "mjbaars1977 at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/29585] sched_getcpu returns invalid results Date: Mon, 26 Sep 2022 11:14:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.35 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mjbaars1977 at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29585 --- Comment #8 from Mischa Baars --- (In reply to Florian Weimer from comment #7) > You cannot call glibc function after creating a bare thread using clone, = you > need to use direct system calls. The bare thread does not have a proper > thread control block set up for glibc. Ok, no problem. I can use syscalls to retrieve the processor the process is running on, but shouldn't glibc check for the existence of this thread cont= rol block and return a -1 when it does not exist instead of a incorrect process= or number? I think that a small note in the manual page about pthreads vs fork / clone would be in order. For example, if the existence of both pthread_yield and sched_yield makes you think that sched_yield is not specifically intended f= or use with pthreads, then why would sched_getcpu be? --=20 You are receiving this mail because: You are on the CC list for the bug.=