Support backup and restore of special files on POSIX style systems

Special files are device nodes and named pipes. The necessity of the
former is clear, the latter is debatable.
In order to preserve backward compatibility, the device number is
encoded in the StartChunk/StartOffset fields of the entry.
This commit is contained in:
2023-10-03 15:08:34 -05:00
committed by John K. Luebs
parent 99e4dcae00
commit 5087ac738d
6 changed files with 72 additions and 8 deletions

View File

@@ -48,6 +48,9 @@ func ioctl(f *os.File, request uintptr, attrp *uint32) error {
}
func (entry *Entry) ReadFileFlags(f *os.File) error {
if entry.IsSpecial() {
return nil
}
var flags uint32
if err := ioctl(f, linux_FS_IOC_GETFLAGS, &flags); err != nil {
return err