PAPI  5.0.1.0
linux-common.h
Go to the documentation of this file.
00001 #ifndef _LINUX_COMMON_H
00002 #define _LINUX_COMMON_H
00003 
00004 #define LINUX_VERSION(a,b,c) ( ((a&0xff)<<24) | ((b&0xff)<<16) | ((c&0xff) << 8))
00005 
00006 #define min(x, y) ({                \
00007     typeof(x) _min1 = (x);          \
00008     typeof(y) _min2 = (y);          \
00009     (void) (&_min1 == &_min2);      \
00010     _min1 < _min2 ? _min1 : _min2; })
00011 
00012 static inline pid_t
00013 mygettid( void )
00014 {
00015 #ifdef SYS_gettid
00016     return syscall( SYS_gettid );
00017 #elif defined(__NR_gettid)
00018     return syscall( __NR_gettid );
00019 #else
00020 #error "cannot find gettid"
00021 #endif
00022 }
00023 
00024 #ifndef F_SETOWN_EX
00025    #define F_SETOWN_EX     15
00026    #define F_GETOWN_EX     16
00027    
00028    #define F_OWNER_TID     0
00029    #define F_OWNER_PID     1
00030    #define F_OWNER_PGRP    2
00031    
00032    struct f_owner_ex {
00033               int     type;
00034               pid_t   pid;
00035    };
00036 #endif
00037 
00038 int _linux_detect_nmi_watchdog();
00039 
00040 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines