MCPcopy Create free account
hub / github.com/MemNixFS/MemNixFS / mode_to_perm_string

Function mode_to_perm_string

src/os/linux/pagecache.cpp:300–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300std::string mode_to_perm_string(u16 m) {
301 char b[10] = "---------";
302 if (m & 0400) b[0]='r';
303 if (m & 0200) b[1]='w';
304 if (m & 0100) b[2]='x';
305 if (m & 0040) b[3]='r';
306 if (m & 0020) b[4]='w';
307 if (m & 0010) b[5]='x';
308 if (m & 0004) b[6]='r';
309 if (m & 0002) b[7]='w';
310 if (m & 0001) b[8]='x';
311 return std::string(b, 9);
312}
313
314// Read a NUL-terminated kernel string of up to maxlen bytes (used for s_id
315// inline char arrays and file_system_type.name pointer chases).

Callers 1

format_pagecache_indexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected