EPICS Multi-Core Utilities  1.2.2-SNAPSHOT
Real-Time Utilities for EPICS IOCs on Multi-Core Linux
 All Files Functions Variables Typedefs Macros Groups Pages
utils.h
Go to the documentation of this file.
1 /********************************************/
12 #ifndef UTILS_H
13 #define UTILS_H
14 
15 #include <sched.h>
16 #include <unistd.h>
17 
18 #include <errlog.h>
19 
20 // TODO: Use libCom call when get-cpus branch is merged
21 #define NO_OF_CPUS sysconf(_SC_NPROCESSORS_CONF)
22 
23 #define checkStatus(status,message) \
24 if((status)) {\
25  errlogPrintf("%s error %s\n", (message), strerror((status))); \
26 }
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
37 extern int cpuDigits;
38 
39 void strToCpuset(cpu_set_t *cpuset, const char *spec);
40 void cpusetToStr(char *set, size_t len, const cpu_set_t *cpuset);
41 const char *policyToStr(const int policy);
42 int strToPolicy(const char *string);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif // UTILS_H