Constant nc::types::S_DT_SHIFT[][src]

pub const S_DT_SHIFT: mode_t = 12;
Expand description

This is a header for the common implementation of dirent to fs on-disk file type conversion. Although the fs on-disk bits are specific to every file system, in practice, many file systems use the exact same on-disk format to describe the lower 3 file type bits that represent the 7 POSIX file types.

It is important to note that the definitions in this header MUST NOT change. This would break both the userspace ABI and the on-disk format of filesystems using this code.

All those file systems can use this generic code for the conversions. struct dirent file types exposed to user via getdents(2), readdir(3)

These match bits 12..15 of stat.st_mode (ie “(i_mode >> 12) & 15”).