6 #include "xlat/modetypes.h"
11 static char buf[sizeof("S_IFSOCK|S_ISUID|S_ISGID|S_ISVTX|%o")
16 if ((mode & S_IFMT) == 0)
18 else if ((s = xlookup(modetypes, mode & S_IFMT)) == NULL) {
19 sprintf(buf, "%#o", mode);
22 s = buf + sprintf(buf, "%s%s%s%s", s,
23 (mode & S_ISUID) ? "|S_ISUID" : "",
24 (mode & S_ISGID) ? "|S_ISGID" : "",
25 (mode & S_ISVTX) ? "|S_ISVTX" : "");
26 mode &= ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX);
28 sprintf((char*)s, "|%#o", mode);
29 s = (*buf == '|') ? buf + 1 : buf;