+
+ /* Handle setuid/sticky bits. You might think the indices are
+ * off by one, but remember there's a type char at the
+ * start. */
+ if (mode & S_ISUID)
+ perms[3] = (mode & S_IXUSR) ? 's' : 'S';
+
+ if (mode & S_ISGID)
+ perms[6] = (mode & S_IXGRP) ? 's' : 'S';
+
+#ifdef S_ISVTX
+ if (mode & S_ISVTX)
+ perms[9] = (mode & S_IXOTH) ? 't' : 'T';
+#endif
+