Skip to content

Commit e135748

Browse files
gurugioojeda
authored andcommitted
rust: kernel: ioctl returns ENOTTY if not implemented
According to fs/ioctl.c, ioctl system call first test the cmd value with do_vfs_ioctl. If the cmd is not supported command, it calls vfs_ioctl. Then vfs_ioctl returns ENOTTY if ioctl is not implemented. Signed-off-by: Gioh Kim <[email protected]> Reviewed-by: Wei Liu <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent d04e27c commit e135748

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust/kernel/file_operations.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ pub trait FileOperations: Send + Sync + Sized {
662662
_file: &File,
663663
_cmd: &mut IoctlCommand,
664664
) -> Result<i32> {
665-
Err(Error::EINVAL)
665+
Err(Error::ENOTTY)
666666
}
667667

668668
/// Performs 32-bit IO control operations on that are specific to the file on 64-bit kernels.
@@ -673,7 +673,7 @@ pub trait FileOperations: Send + Sync + Sized {
673673
_file: &File,
674674
_cmd: &mut IoctlCommand,
675675
) -> Result<i32> {
676-
Err(Error::EINVAL)
676+
Err(Error::ENOTTY)
677677
}
678678

679679
/// Syncs pending changes to this file.

0 commit comments

Comments
 (0)