Skip to content

fix: repair DeviceType enum in mknod to be hydrated from mode and rdev#96

Open
khanhtranngoccva wants to merge 2 commits intoAlogani:develfrom
khanhtranngoccva:rdev-u64
Open

fix: repair DeviceType enum in mknod to be hydrated from mode and rdev#96
khanhtranngoccva wants to merge 2 commits intoAlogani:develfrom
khanhtranngoccva:rdev-u64

Conversation

@khanhtranngoccva
Copy link
Copy Markdown
Contributor

This PR aims to fix the rdev field in the mknod method. The original rdev field in libfuse is 32 bits wide and supplies only the major (20 bits) and minor device number (12 bits) if the requested file type to create is a block device or a character device, but it does not really supply anything else, including the file type bits. The device numbers can be extracted using libc::major and libc::minor, and can be reconstructed using libc::makedev.

EINVAL is returned in mknod if the requested file mode cannot be mapped to a known file type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant