From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: beniaminsandu@gmail.com, linux-trace-devel@vger.kernel.org
Subject: [PATCH v2] libtracefs: make it build against musl C library
Date: Wed, 2 Dec 2020 19:34:52 +0200 [thread overview]
Message-ID: <20201202173452.440349-1-tz.stoyanov@gmail.com> (raw)
From: Beniamin Sandu <beniaminsandu@gmail.com>
* 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
Link: https://lore.kernel.org/linux-trace-devel/20201130122755.31000-1-beniaminsandu@gmail.com
Reviewed-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
[ Fixed a whitespace issue ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
include/tracefs-local.h | 12 ++++++++++++
tracefs-events.c | 1 +
2 files changed, 13 insertions(+)
diff --git a/include/tracefs-local.h b/include/tracefs-local.h
index 9cc371b..bdbf89e 100644
--- a/include/tracefs-local.h
+++ b/include/tracefs-local.h
@@ -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 */
diff --git a/tracefs-events.c b/tracefs-events.c
index ca1d22b..ee45988 100644
--- a/tracefs-events.c
+++ b/tracefs-events.c
@@ -13,6 +13,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <limits.h>
#include <traceevent/kbuffer.h>
--
2.28.0
reply other threads:[~2020-12-02 17:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201202173452.440349-1-tz.stoyanov@gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=beniaminsandu@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).