From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E5E12211B3 for ; Wed, 5 Dec 2018 15:49:23 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=t9TXd hWhL8RI39LGHnCio7j0sUakMNuJuZaQ93TNy0UQ/XJ2RWWAptgtEhSp3io79tnB5 L4Dsik7DC9aRY0czfsLGx/N2FDDmCBOh3qGUiRQBr9vMnf0hMWI1qYN9pqYKc7/p 6LP7N+v8geZNwOtMrLh2/KJ4F+j84omuw8UvKM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=FfHBsLrH728 BreCFlpC5L4eEo58=; b=gMhU0Wohp8vx7VxAIX03mBePnUaM1zE2YpUQVIs9/Lr 4g9jjlMdZl6HfOzlGCbjJHsiNJwIL3szFhU9V6gLO8Ql13JaJXLCqAvq+aozfNvL PYMD1GU36h4K8xN+bnO745u1A0YKRq7Vr+x2N8EB5J60TVy1fzp/a3yTwUS1AyNQ = Received: (qmail 56695 invoked by alias); 5 Dec 2018 15:49:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 56435 invoked by uid 89); 5 Dec 2018 15:49:01 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com From: Florian Weimer To: "H.J. Lu" Cc: GNU C Library Subject: Re: RFC: Add getcpu wrapper References: <87pnuggf5z.fsf@oldenburg2.str.redhat.com> Date: Wed, 05 Dec 2018 16:48:43 +0100 In-Reply-To: (H. J. Lu's message of "Wed, 5 Dec 2018 07:40:12 -0800") Message-ID: <87lg54gejo.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain * H. J. Lu: > On Wed, Dec 5, 2018 at 7:35 AM Florian Weimer wrote: >> >> * H. J. Lu: >> >> > returns such info. But syscall () is too slow. I'd like to add a wrapper to >> > glibc. Any comments? >> >> We already have it as sched_getcpu, I think. >> > > We have > > int > sched_getcpu (void) > { > #ifdef __NR_getcpu > unsigned int cpu; > int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL); > > ^^^^^ I need the node info. > > return r == -1 ? r : cpu; > #else > __set_errno (ENOSYS); > return -1; > #endif > } Ah, so you want to pass a non-null second argument to getcpu? I think we can expose getcpu (with two arguments), under that name. Add it to or ; I do not have a strong preference. Thanks, Florian