summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 99658f0975..55246f5a4d 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -6194,7 +6194,7 @@ int fd_warn_permissions(const char *path, int fd) {
return 0;
}
-unsigned long parse_personality(const char *p) {
+unsigned long personality_from_string(const char *p) {
/* Parse a personality specifier. We introduce our own
* identifiers that indicate specific ABIs, rather than just
@@ -6222,3 +6222,22 @@ unsigned long parse_personality(const char *p) {
* as error indicator. */
return 0xffffffffUL;
}
+
+const char* personality_to_string(unsigned long p) {
+
+#if defined(__x86_64__)
+
+ if (p == PER_LINUX32)
+ return "x86";
+
+ if (p == PER_LINUX)
+ return "x86-64";
+
+#elif defined(__i386__)
+
+ if (p == PER_LINUX)
+ return "x86";
+#endif
+
+ return NULL;
+}