ANDROID: ashmem_rust: add compat_ioctl
On 32-bit systems, some of the ioctls are slightly different. Bug: 370906207 Change-Id: Ibff577177a2e12f63156a99e5ffeeb8392ded4c2 Signed-off-by: Alice Ryhl <aliceryhl@google.com>
This commit is contained in:
committed by
Treehugger Robot
parent
0a8dbd6b7b
commit
fe77a05bbe
@@ -109,6 +109,16 @@ impl MiscDevice for Ashmem {
|
||||
_ => Err(EINVAL),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(CONFIG_COMPAT)]
|
||||
fn compat_ioctl(me: Pin<&Ashmem>, file: &File, compat_cmd: u32, arg: usize) -> Result<isize> {
|
||||
let cmd = match compat_cmd {
|
||||
bindings::COMPAT_ASHMEM_SET_SIZE => bindings::ASHMEM_SET_SIZE,
|
||||
bindings::COMPAT_ASHMEM_SET_PROT_MASK => bindings::ASHMEM_SET_PROT_MASK,
|
||||
_ => compat_cmd,
|
||||
};
|
||||
Self::ioctl(me, file, cmd, arg)
|
||||
}
|
||||
}
|
||||
|
||||
impl Ashmem {
|
||||
|
||||
Reference in New Issue
Block a user