LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 08-11-2008, 09:06 AM   #1
deedhnd
LQ Newbie
 
Registered: Apr 2008
Posts: 16

Rep: Reputation: 0
including /usr/include/linux/ header files throwing errors in SLES 10.2


I am including /usr/include/linux/smp.h
/usr/include/linux/preempt.h
/usr/include/linux/config.h

in my source code,because the get_cpu() function needs these headers.
But I am getting errors

********************************************************
/usr/include/linux/smp.h:74:1: warning: this is the location of the previous definition
/usr/include/linux/bitops.h: In function 'int generic_fls64(__u64)':
/usr/include/linux/bitops.h:84: error: 'fls' was not declared in this scope
/usr/include/linux/bitops.h:85: error: 'fls' was not declared in this scope
/usr/include/linux/bitops.h: In function 'int get_bitmask_order(unsigned int)':
/usr/include/linux/bitops.h:92: error: 'fls' was not declared in this scope
/usr/include/linux/bitops.h: In function 'int get_count_order(unsigned int)':
/usr/include/linux/bitops.h:100: error: 'fls' was not declared in this scope
/usr/include/asm/percpu.h: At global scope:
/usr/include/asm/percpu.h:39: error: 'CONFIG_NR_CPUS' was not declared in this scope
/usr/include/asm/unwind.h:97: error: 'u64' does not name a type
/usr/include/asm/unwind.h:98: error: 'u64' does not name a type
/usr/include/asm/unwind.h:99: error: 'u64' does not name a type
/usr/include/asm-generic/atomic.h: In function 'long int atomic_long_read(atomic_long_t*)':
/usr/include/asm-generic/atomic.h:78: error: 'atomic_read' was not declared in this scope
/usr/include/asm-generic/atomic.h: In function 'void atomic_long_set(atomic_long_t*, long int)':
/usr/include/asm-generic/atomic.h:85: error: 'atomic_set' was not declared in this scope
/usr/include/asm-generic/atomic.h: In function 'void atomic_long_inc(atomic_long_t*)':
/usr/include/asm-generic/atomic.h:92: error: 'atomic_inc' was not declared in this scope
/usr/include/asm-generic/atomic.h: In function 'void atomic_long_dec(atomic_long_t*)':
/usr/include/asm-generic/atomic.h:99: error: 'atomic_dec' was not declared in this scope
/usr/include/asm-generic/atomic.h: In function 'void atomic_long_add(long int, atomic_long_t*)':
/usr/include/asm-generic/atomic.h:106: error: 'atomic_add' was not declared in this scope
/usr/include/asm-generic/atomic.h: In function 'void atomic_long_sub(long int, atomic_long_t*)':
/usr/include/asm-generic/atomic.h:113: error: 'atomic_sub' was not declared in this scope
/usr/include/asm/processor.h: In function 'int ia64_get_irr(unsigned int)':
/usr/include/asm/processor.h:570: error: 'u64' was not declared in this scope
/usr/include/asm/processor.h:570: error: expected `;' before 'irr'
/usr/include/asm/processor.h:573: error: 'irr' was not declared in this scope
/usr/include/asm/processor.h:579: error: 'irr' was not declared in this scope
/usr/include/asm/processor.h: In function 'void* ia64_imva(void*)':
/usr/include/asm/processor.h:691: error: '__va' was not declared in this scope
/usr/include/linux/bitmap.h: At global scope:
/usr/include/linux/bitmap.h:110: error: expected ',' or '...' before 'new'
/usr/include/linux/bitmap.h:112: error: expected ',' or '...' before 'new'
/usr/include/linux/bitmap.h: In function 'void bitmap_zero(long unsigned int*, int)':
/usr/include/linux/bitmap.h:125: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h:128: error: 'BITS_TO_LONGS' was not declared in this scope
/usr/include/linux/bitmap.h:129: error: 'memset' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'void bitmap_fill(long unsigned int*, int)':
/usr/include/linux/bitmap.h:135: error: 'BITS_TO_LONGS' was not declared in this scope
/usr/include/linux/bitmap.h:138: error: 'memset' was not declared in this scope
/usr/include/linux/bitmap.h:140: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'void bitmap_copy(long unsigned int*, const long unsigned int*, int)':
/usr/include/linux/bitmap.h:146: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h:149: error: 'BITS_TO_LONGS' was not declared in this scope
/usr/include/linux/bitmap.h:150: error: 'memcpy' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'void bitmap_and(long unsigned int*, const long unsigned int*, const long unsigned int*, int)':
/usr/include/linux/bitmap.h:157: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'void bitmap_or(long unsigned int*, const long unsigned int*, const long unsigned int*, int)':
/usr/include/linux/bitmap.h:166: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'void bitmap_xor(long unsigned int*, const long unsigned int*, const long unsigned int*, int)':
/usr/include/linux/bitmap.h:175: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'void bitmap_andnot(long unsigned int*, const long unsigned int*, const long unsigned int*, int)':
/usr/include/linux/bitmap.h:184: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'void bitmap_complement(long unsigned int*, const long unsigned int*, int)':
/usr/include/linux/bitmap.h:193: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'int bitmap_equal(const long unsigned int*, const long unsigned int*, int)':
/usr/include/linux/bitmap.h:202: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'int bitmap_intersects(const long unsigned int*, const long unsigned int*, int)':
/usr/include/linux/bitmap.h:211: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'int bitmap_subset(const long unsigned int*, const long unsigned int*, int)':
/usr/include/linux/bitmap.h:220: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'int bitmap_empty(const long unsigned int*, int)':
/usr/include/linux/bitmap.h:228: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'int bitmap_full(const long unsigned int*, int)':
/usr/include/linux/bitmap.h:236: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'void bitmap_shift_right(long unsigned int*, const long unsigned int*, int, int)':
/usr/include/linux/bitmap.h:250: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/bitmap.h: In function 'void bitmap_shift_left(long unsigned int*, const long unsigned int*, int, int)':
/usr/include/linux/bitmap.h:259: error: 'BITS_PER_LONG' was not declared in this scope
/usr/include/linux/cpumask.h: At global scope:
/usr/include/linux/cpumask.h:88: error: 'bits' has not been declared
/usr/include/linux/cpumask.h:88: error: 'CONFIG_NR_CPUS' has not been declared
/usr/include/linux/cpumask.h: In function 'void __cpu_set(int, volatile cpumask_t*)':
/usr/include/linux/cpumask.h:94: error: 'volatile struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpu_clear(int, volatile cpumask_t*)':
/usr/include/linux/cpumask.h:100: error: 'volatile struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_setall(cpumask_t*, int)':
/usr/include/linux/cpumask.h:106: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_clear(cpumask_t*, int)':
/usr/include/linux/cpumask.h:112: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpu_test_and_set(int, cpumask_t*)':
/usr/include/linux/cpumask.h:121: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_and(cpumask_t*, const cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:128: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:128: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:128: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_or(cpumask_t*, const cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:135: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:135: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:135: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_xor(cpumask_t*, const cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:142: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:142: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:142: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_andnot(cpumask_t*, const cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:150: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:150: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:150: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_complement(cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:157: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:157: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpus_equal(const cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:164: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:164: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpus_intersects(const cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:171: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:171: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpus_subset(const cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:178: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:178: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpus_empty(const cpumask_t*, int)':
/usr/include/linux/cpumask.h:184: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpus_full(const cpumask_t*, int)':
/usr/include/linux/cpumask.h:190: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpus_weight(const cpumask_t*, int)':
/usr/include/linux/cpumask.h:196: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_shift_right(cpumask_t*, const cpumask_t*, int, int)':
/usr/include/linux/cpumask.h:204: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:204: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_shift_left(cpumask_t*, const cpumask_t*, int, int)':
/usr/include/linux/cpumask.h:212: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:212: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __first_cpu(const cpumask_t*, int)':
/usr/include/linux/cpumask.h:218: error: expected primary-expression before 'int'
/usr/include/linux/cpumask.h:218: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:218: error: 'min_t' was not declared in this scope
/usr/include/linux/cpumask.h: In function 'int __next_cpu(int, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:224: error: expected primary-expression before 'int'
/usr/include/linux/cpumask.h:224: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:224: error: 'min_t' was not declared in this scope
/usr/include/linux/cpumask.h: In function 'int __cpumask_scnprintf(char*, int, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:275: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpumask_parse(const char*, int, cpumask_t*, int)':
/usr/include/linux/cpumask.h:283: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpulist_scnprintf(char*, int, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:291: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpulist_parse(const char*, cpumask_t*, int)':
/usr/include/linux/cpumask.h:297: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'int __cpu_remap(int, const cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:305: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:305: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h: In function 'void __cpus_remap(cpumask_t*, const cpumask_t*, const cpumask_t*, const cpumask_t*, int)':
/usr/include/linux/cpumask.h:313: error: 'struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:313: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:313: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/linux/cpumask.h:313: error: 'const struct cpumask_t' has no member named 'bits'
/usr/include/asm/io.h: In function 'unsigned int ___ia64_inb(long unsigned int)':
/usr/include/asm/io.h:171: error: invalid conversion from 'void*' to 'volatile unsigned char*'
/usr/include/asm/io.h: In function 'unsigned int ___ia64_inw(long unsigned int)':
/usr/include/asm/io.h:182: error: invalid conversion from 'void*' to 'volatile short unsigned int*'
/usr/include/asm/io.h: In function 'unsigned int ___ia64_inl(long unsigned int)':
/usr/include/asm/io.h:193: error: invalid conversion from 'void*' to 'volatile unsigned int*'
/usr/include/asm/io.h: In function 'void ___ia64_outb(unsigned char, long unsigned int)':
/usr/include/asm/io.h:204: error: invalid conversion from 'void*' to 'volatile unsigned char*'
/usr/include/asm/io.h: In function 'void ___ia64_outw(short unsigned int, long unsigned int)':
/usr/include/asm/io.h:213: error: invalid conversion from 'void*' to 'volatile short unsigned int*'
/usr/include/asm/io.h: In function 'void ___ia64_outl(unsigned int, long unsigned int)':
/usr/include/asm/io.h:222: error: invalid conversion from 'void*' to 'volatile unsigned int*'
/usr/include/asm/io.h: In function 'void __insb(long unsigned int, void*, long unsigned int)':
/usr/include/asm/io.h:231: error: invalid conversion from 'void*' to 'unsigned char*'
/usr/include/asm/io.h:234: error: 'platform_inb' was not declared in this scope
/usr/include/asm/io.h: In function 'void __insw(long unsigned int, void*, long unsigned int)':
/usr/include/asm/io.h:240: error: invalid conversion from 'void*' to 'short unsigned int*'
/usr/include/asm/io.h:243: error: 'platform_inw' was not declared in this scope
/usr/include/asm/io.h: In function 'void __insl(long unsigned int, void*, long unsigned int)':
/usr/include/asm/io.h:249: error: invalid conversion from 'void*' to 'unsigned int*'
/usr/include/asm/io.h:252: error: 'platform_inl' was not declared in this scope
/usr/include/asm/io.h: In function 'void __outsb(long unsigned int, const void*, long unsigned int)':
/usr/include/asm/io.h:258: error: invalid conversion from 'const void*' to 'const unsigned char*'
/usr/include/asm/io.h:261: error: 'platform_outb' was not declared in this scope
/usr/include/asm/io.h: In function 'void __outsw(long unsigned int, const void*, long unsigned int)':
/usr/include/asm/io.h:267: error: invalid conversion from 'const void*' to 'const short unsigned int*'
/usr/include/asm/io.h:270: error: 'platform_outw' was not declared in this scope
/usr/include/asm/io.h: In function 'void __outsl(long unsigned int, const void*, long unsigned int)':
/usr/include/asm/io.h:276: error: invalid conversion from 'const void*' to 'const unsigned int*'
/usr/include/asm/io.h:279: error: 'platform_outl' was not declared in this scope
/usr/include/asm/smp.h: At global scope:
/usr/include/asm/smp.h:53: error: 'CONFIG_NR_CPUS' was not declared in this scope
/usr/include/asm/smp.h:59: error: 'CONFIG_NR_CPUS' was not declared in this scope
/usr/include/asm/smp.h:60: error: 'CONFIG_NR_CPUS' was not declared in this scope
/usr/include/asm/smp.h: In function 'int cpu_logical_id(int)':
/usr/include/asm/smp.h:80: error: 'CONFIG_NR_CPUS' was not declared in this scope
/usr/include/asm/smp.h: In function 'void min_xtp()':
/usr/include/asm/smp.h:97: error: pointer of type 'void *' used in arithmetic
/usr/include/asm/smp.h: In function 'void normal_xtp()':
/usr/include/asm/smp.h:104: error: pointer of type 'void *' used in arithmetic
/usr/include/asm/smp.h: In function 'void max_xtp()':
/usr/include/asm/smp.h:111: error: pointer of type 'void *' used in arithmetic
/usr/include/stdlib.h: At global scope:
/usr/include/stdlib.h:541: error: declaration does not declare anything
/usr/include/c++/4.1.0/bits/stl_iterator.h:100: error: expected unqualified-id before 'struct'
/usr/include/c++/4.1.0/bits/stl_iterator.h:100: error: expected `)' before 'struct'
/usr/include/c++/4.1.0/bits/stl_iterator.h:100: error: expected `)' before 'struct'
/usr/include/c++/4.1.0/bits/stl_iterator.h:100: error: expected unqualified-id before ')' token
/usr/include/c++/4.1.0/bits/stl_iterator.h: In constructor 'std::reverse_iterator<_Iterator>::reverse_iterato r()':
/usr/include/c++/4.1.0/bits/stl_iterator.h:116: error: anachronistic old-style base class initializer
/usr/include/c++/4.1.0/bits/stl_iterator.h:116: error: expected `{' before '(' token
/usr/include/c++/4.1.0/bits/stl_iterator.h: In constructor 'std::reverse_iterator<_Iterator>::reverse_iterato r(_Iterator)':
/usr/include/c++/4.1.0/bits/stl_iterator.h:122: error: anachronistic old-style base class initializer
/usr/include/c++/4.1.0/bits/stl_iterator.h:122: error: expected `{' before '(' token
/usr/include/c++/4.1.0/bits/stl_iterator.h: In copy constructor 'std::reverse_iterator<_Iterator>::reverse_iterato r(const std::reverse_iterator<_Iterator>&)':
/usr/include/c++/4.1.0/bits/stl_iterator.h:128: error: anachronistic old-style base class initializer
/usr/include/c++/4.1.0/bits/stl_iterator.h:128: error: expected `{' before '(' token
/usr/include/c++/4.1.0/bits/stl_iterator.h: In constructor 'std::reverse_iterator<_Iterator>::reverse_iterato r(const std::reverse_iterator<_Iter>&)':
/usr/include/c++/4.1.0/bits/stl_iterator.h:136: error: anachronistic old-style base class initializer
/usr/include/c++/4.1.0/bits/stl_iterator.h:136: error: expected `{' before '(' token
/usr/include/c++/4.1.0/bits/stl_iterator.h: In member function 'std::reverse_iterator<_Iterator>& std::reverse_iterator<_Iterator>erator++()':
/usr/include/c++/4.1.0/bits/stl_iterator.h:174: error: cannot decrement a pointer to incomplete type 'task_struct'
/usr/include/c++/4.1.0/bits/stl_iterator.h: In member function 'std::reverse_iterator<_Iterator> std::reverse_iterator<_Iterator>erator++(int)' :
/usr/include/c++/4.1.0/bits/stl_iterator.h:187: error: cannot decrement a pointer to incomplete type 'task_struct'
/usr/include/c++/4.1.0/bits/stl_iterator.h: In member function 'std::reverse_iterator<_Iterator>& std::reverse_iterator<_Iterator>erator--()':
/usr/include/c++/4.1.0/bits/stl_iterator.h:199: error: cannot increment a pointer to incomplete type 'task_struct'
/usr/include/c++/4.1.0/bits/stl_iterator.h: In member function 'std::reverse_iterator<_Iterator> std::reverse_iterator<_Iterator>erator--(int)':
/usr/include/c++/4.1.0/bits/stl_iterator.h:212: error: cannot increment a pointer to incomplete type 'task_struct'
************************************************** *********
Can you help me in sorting out these errors....thnx in advance
 
Old 08-12-2008, 11:01 PM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,092
Blog Entries: 2

Rep: Reputation: 109Reputation: 109
Wow your just looking for pain. Your mixing c, c++, and kernel headers. For the kernel headers you'll need to do a:

Code:
extern "C" {
#include </usr/include/linux/smp.h>
#include <usr/include/linux/preempt.h>
#include </usr/include/linux/config.h>
};
Most likely the function that your trying to use won't work anyway if this is a userspace program.
 
Old 08-14-2008, 06:22 AM   #3
deedhnd
LQ Newbie
 
Registered: Apr 2008
Posts: 16

Original Poster
Rep: Reputation: 0
but i want to use the get_cpu() function in my program...
please tell me how to do it...??
 
Old 08-14-2008, 02:25 PM   #4
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,092
Blog Entries: 2

Rep: Reputation: 109Reputation: 109
Well if you are running a new enough kernel (and new enough libc) you can use the getcpu system call.

man 2 getcpu
 
Old 08-15-2008, 09:36 AM   #5
deedhnd
LQ Newbie
 
Registered: Apr 2008
Posts: 16

Original Poster
Rep: Reputation: 0
well i am using 2.6.16 kernel with gcc version 4.1.2

I am writing a sample program

extern "C"
{
#include<linux/smp.h>
#include<linux/preempt.h>
}
int main()
{
int result;
result=get_cpu();
return 0;
}

on compiling...
it gives the same set of errors...

Is there some way to remove these errors...
or any other way(other system calls or any assembly code) which can replicate the functionality of get_cpu()
 
Old 08-15-2008, 10:28 AM   #6
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,092
Blog Entries: 2

Rep: Reputation: 109Reputation: 109
Looks like getcpu() syscall wasn't added until 2.6.19

you might want to try sched_getcpu()

Code:
extern "C" {
#define _GNU_SOURCE
#include <utpmx.h>
};

int main(void) {
  int result;
  result = sched_getcpu();
  return 0;
}
 
Old 08-18-2008, 03:32 AM   #7
deedhnd
LQ Newbie
 
Registered: Apr 2008
Posts: 16

Original Poster
Rep: Reputation: 0
The above sched_getcpu() program also isnt compiling successfully saying
undefined reference to sched_getcpu()...
 
Old 08-18-2008, 09:02 AM   #8
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,092
Blog Entries: 2

Rep: Reputation: 109Reputation: 109
Sorry then, I guess you either need to upgrade or find another way.
 
Old 08-19-2008, 07:50 AM   #9
deedhnd
LQ Newbie
 
Registered: Apr 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Is there any way to replace the functionality of get_cpu() with some other system calls which serves the same as get_cpu()??

or any other way...

Pls suggest ....I am stuck...

Thanx
 
Old 08-19-2008, 08:08 AM   #10
deedhnd
LQ Newbie
 
Registered: Apr 2008
Posts: 16

Original Poster
Rep: Reputation: 0
the above suggested use of sched_getcpu() program gives undefined reference to sched_getcpu while linking........
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C Header files missing in /usr/include zorro_kwh Ubuntu 3 04-12-2008 06:57 PM
/usr/include/regex.h errors? gbowden Slackware 0 07-03-2007 11:03 AM
Include kernel header files fallen3019 Programming 10 05-12-2007 08:35 PM
Including header files and source files for classes Feenix Programming 8 09-28-2005 10:53 AM
How to write Makefile in 2.6 for including header files in another dir ? ashbalu Programming 0 10-19-2004 03:45 PM


All times are GMT -5. The time now is 10:28 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration