From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26084 invoked by alias); 17 Jul 2007 18:55:13 -0000 Received: (qmail 26060 invoked by uid 22791); 17 Jul 2007 18:55:12 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 17 Jul 2007 18:55:00 +0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id l6HIwUO2005466; Tue, 17 Jul 2007 20:58:30 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id l6HIwTGc005465; Tue, 17 Jul 2007 20:58:29 +0200 Date: Tue, 17 Jul 2007 18:55:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix __sched_cpucount Message-ID: <20070717185829.GX4603@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00027.txt.bz2 Hi! This patch makes CPU_COUNT macro working even in C++ and as an added bonus fixes also bits/sched.h which got out of sync with linux version of this header during last change. 2007-07-17 Jakub Jelinek * sysdeps/unix/sysv/linux/bits/sched.h (__sched_cpucount): Add __BEGIN_DECLS/__END_DECLS around the prototype. * bits/sched.h (__sched_cpucount): Likewise. Make second argument pointer to const cpu_set_t. --- libc/sysdeps/unix/sysv/linux/bits/sched.h.jj 2007-06-12 14:08:19.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/bits/sched.h 2007-07-17 20:45:00.000000000 +0200 @@ -131,8 +131,14 @@ typedef struct ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu)) # define __CPU_ISSET(cpu, cpusetp) \ (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0) + +__BEGIN_DECLS + extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) __THROW; + +__END_DECLS + # define __CPU_COUNT(cpusetp) \ __sched_cpucount (sizeof (cpu_set_t), cpusetp) #endif --- libc/bits/sched.h.jj 2007-04-23 10:54:00.000000000 +0200 +++ libc/bits/sched.h 2007-07-17 20:46:06.000000000 +0200 @@ -68,7 +68,14 @@ typedef struct ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu)) # define __CPU_ISSET(cpu, cpusetp) \ (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0) -extern int __sched_cpucount (size_t __setsize, cpu_set_t *__setp) __THROW; + +__BEGIN_DECLS + +extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) + __THROW; + +__END_DECLS + # define __CPU_COUNT(cpusetp) \ __sched_cpucount (sizeof (cpu_set_t), cpusetp) #endif Jakub