libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
prctl.cxx
1// cosmos
2#include <cosmos/compiler.hxx>
3
4// Linux
5#ifdef COSMOS_X86
6# include <asm/prctl.h> // arch_prctl constants
7# include <sys/prctl.h>
8#endif
9
10// clues
11#include <clues/items/prctl.hxx>
12#include <clues/macros.h>
13
14namespace clues::item {
15
16#ifdef CLUES_HAVE_ARCH_PRCTL
17std::string ArchOpParameter::str() const {
18 switch (valueAs<int>()) {
19#ifdef COSMOS_X86
20 CASE_ENUM_TO_STR(ARCH_SET_CPUID);
21 CASE_ENUM_TO_STR(ARCH_GET_CPUID);
22#ifdef COSMOS_X86_64
23 CASE_ENUM_TO_STR(ARCH_SET_FS);
24 CASE_ENUM_TO_STR(ARCH_GET_FS);
25 CASE_ENUM_TO_STR(ARCH_SET_GS);
26 CASE_ENUM_TO_STR(ARCH_GET_GS);
27#endif // COSMOS_X86_64
28#endif // COSMOS_X86
29 default: return "unknown";
30 }
31}
32#endif
33
34} // end ns