What does DT_WHT means in /usr/include/dirent.h ?
Asked Answered
F

2

7

I am reading the source code of the dirent.h there's a enum

enum
{
    DT_UNKNOWN = 0,  // unknown type
    #define DT_UNKNOWN DT_UNKNOWN
    DT_FIFO = 1,     // a named pipe, or FIFO
    #define DT_FIFO DT_FIFO
    DT_CHR = 2,     // a character device
    #define DT_CHR DT_CHR
    DT_DIR = 4,     // a directory
    #define DT_DIR DT_DIR
    DT_BLK = 6,     // a block device
    #define DT_BLK DT_BLK
    DT_REG = 8,     // regular file
    #define DT_REG DT_REG
    DT_LNK = 10,    // symbolic link
    #define DT_LNK DT_LNK
    DT_SOCK = 12,   // local domain socket
    #define DT_SOCK DT_SOCK
    DT_WHT = 14     // ?
    #define DT_WHT DT_WHT
};

SO what is DT_WHT? I've searched the Single Unix Specification Version 4, and got nothing. My distro is CentOS 6.2 x64 Linux Kernel Version is: 2.6.32-220.x16.x86_64.

Thank you very much!

Fundus answered 30/10, 2012 at 4:33 Comment(1)
askubuntu.com/questions/39826/…Hematite
E
3

I googled readdir DT_WHT and found this thread which explains that it's a "whiteout" from BSD.

Elfie answered 30/10, 2012 at 6:27 Comment(0)
B
0

In a layered filesystem, an upper layer may contain "whiteout" inodes to hide files from lower layer.

DT_WHT inode type is supported but ignored in Linux kernel. This is also documented in man page rename(2):

BSD union mount employs a separate inode type, DT_WHT, which, while supported by some filesystems available in Linux, such as CODA and XFS, is ignored by the kernel's whiteout support code, as of Linux 4.19, at least.

Borglum answered 4/7, 2023 at 9:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.