libtracefs: make it build against musl C library
PATCH v2 1/1 libtracefs: make it build against musl C library
From: Beniamin Sandu <[email protected]>
* add some missing headers and macros
* set pthread affinity using pthread_setaffinity_np after creating the thread instead of pthread_attr_setaffinity_np (which seems to not be implemented in musl)
Tested using https://musl.cc/x86_64-linux-musl-native.tgz
Reviewed-by Tzvetomir Stoyanov (VMware) <[email protected]>
Signed-off-by Beniamin Sandu <[email protected]>
[ Fixed a whitespace issue ]
Signed-off-by Steven Rostedt (VMware) <[email protected]>
Signed-off-by Tzvetomir Stoyanov (VMware) <[email protected]>
--- include/tracefs-local.h | 12 ++++++++++++ tracefs-events.c | 1 + 2 files changed, 13 insertions(+)
include/tracefs-local.h +12 -0
@@ -13,4 +13,16 @@ void warning(const char *fmt, ...);int str_read_file (const char *file,char **buffer);char *trace_append_file (const char *dir,const char *name); +#ifndef ACCESSPERMS +#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)/* 0777 */ +#endif + +#ifndef ALLPERMS +#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */ +#endif + +#ifndef DEFFILEMODE +#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/ +#endif +#endif /* _TRACE_FS_LOCAL_H */
tracefs-events.c +1 -0
@@ -13,6 +13,7 @@#include <errno.h> #include <sys/stat.h> #include <fcntl.h> +#include <limits.h> #include <traceevent/kbuffer.h>
Signature · 1 line
2.28.0