aboutsummaryrefslogtreecommitdiffstats
path: root/examples/loadables/finfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/loadables/finfo.c')
-rw-r--r--examples/loadables/finfo.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/loadables/finfo.c b/examples/loadables/finfo.c
index c0b0365..ab3c9a4 100644
--- a/examples/loadables/finfo.c
+++ b/examples/loadables/finfo.c
@@ -196,6 +196,13 @@ int m;
obits[i++] = 'x';
obits[i] = '\0';
+ if (m & S_ISUID)
+ ubits[2] = (m & S_IXUSR) ? 's' : 'S';
+ if (m & S_ISGID)
+ gbits[2] = (m & S_IXGRP) ? 's' : 'S';
+ if (m & S_ISVTX)
+ obits[2] = (m & S_IXOTH) ? 't' : 'T';
+
printf ("u=%s,g=%s,o=%s", ubits, gbits, obits);
}
@@ -217,6 +224,10 @@ int mode;
printf("S_IFLNK ");
if (S_ISSOCK(mode))
printf("S_IFSOCK ");
+#ifdef S_ISWHT
+ if (S_ISWHT(mode))
+ printf("S_ISWHT ");
+#endif
perms(getperm(mode));
printf("\n");
}