mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-17 12:47:16 +00:00
Remove module-level allowed lints in system call handlers
This commit is contained in:
parent
a739b3828d
commit
19ad2a2eb4
@ -1,6 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(non_camel_case_types)]
|
|
||||||
use core::time::Duration;
|
use core::time::Duration;
|
||||||
|
|
||||||
use int_to_c_enum::TryFromInt;
|
use int_to_c_enum::TryFromInt;
|
||||||
@ -34,6 +33,7 @@ pub fn sys_clock_gettime(clockid: clockid_t, timespec_addr: Vaddr) -> Result<Sys
|
|||||||
// The hard-coded clock IDs.
|
// The hard-coded clock IDs.
|
||||||
#[derive(Debug, Copy, Clone, TryFromInt, PartialEq)]
|
#[derive(Debug, Copy, Clone, TryFromInt, PartialEq)]
|
||||||
#[repr(i32)]
|
#[repr(i32)]
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
pub enum ClockId {
|
pub enum ClockId {
|
||||||
CLOCK_REALTIME = 0,
|
CLOCK_REALTIME = 0,
|
||||||
CLOCK_MONOTONIC = 1,
|
CLOCK_MONOTONIC = 1,
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(unused_variables)]
|
|
||||||
|
|
||||||
use ostd::cpu::UserContext;
|
use ostd::cpu::UserContext;
|
||||||
|
|
||||||
use super::SyscallReturn;
|
use super::SyscallReturn;
|
||||||
@ -11,7 +9,6 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub fn sys_fork(parent_context: &UserContext) -> Result<SyscallReturn> {
|
pub fn sys_fork(parent_context: &UserContext) -> Result<SyscallReturn> {
|
||||||
let current = current!();
|
|
||||||
let clone_args = CloneArgs::for_fork();
|
let clone_args = CloneArgs::for_fork();
|
||||||
let child_pid = clone_child(parent_context, clone_args).unwrap();
|
let child_pid = clone_child(parent_context, clone_args).unwrap();
|
||||||
Ok(SyscallReturn::Return(child_pid as _))
|
Ok(SyscallReturn::Return(child_pid as _))
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
use core::marker::PhantomData;
|
use core::marker::PhantomData;
|
||||||
|
|
||||||
use super::SyscallReturn;
|
use super::SyscallReturn;
|
||||||
@ -234,6 +232,7 @@ impl DirentSerializer for Dirent64 {
|
|||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
enum DirentType {
|
enum DirentType {
|
||||||
|
#[allow(dead_code)]
|
||||||
DT_UNKNOWN = 0,
|
DT_UNKNOWN = 0,
|
||||||
DT_FIFO = 1,
|
DT_FIFO = 1,
|
||||||
DT_CHR = 2,
|
DT_CHR = 2,
|
||||||
@ -242,6 +241,7 @@ enum DirentType {
|
|||||||
DT_REG = 8,
|
DT_REG = 8,
|
||||||
DT_LNK = 10,
|
DT_LNK = 10,
|
||||||
DT_SOCK = 12,
|
DT_SOCK = 12,
|
||||||
|
#[allow(dead_code)]
|
||||||
DT_WHT = 14,
|
DT_WHT = 14,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(non_camel_case_types)]
|
|
||||||
|
|
||||||
use int_to_c_enum::TryFromInt;
|
use int_to_c_enum::TryFromInt;
|
||||||
|
|
||||||
use super::SyscallReturn;
|
use super::SyscallReturn;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
//! This mod defines mmap flags and the handler to syscall mmap
|
//! This mod defines mmap flags and the handler to syscall mmap
|
||||||
|
|
||||||
use align_ext::AlignExt;
|
use align_ext::AlignExt;
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(dead_code)]
|
|
||||||
#![allow(unused_variables)]
|
|
||||||
|
|
||||||
use super::SyscallReturn;
|
use super::SyscallReturn;
|
||||||
use crate::{
|
use crate::{
|
||||||
prelude::*,
|
prelude::*,
|
||||||
@ -85,7 +82,9 @@ pub enum PrctlCmd {
|
|||||||
PR_GET_PDEATHSIG(Vaddr),
|
PR_GET_PDEATHSIG(Vaddr),
|
||||||
PR_SET_NAME(Vaddr),
|
PR_SET_NAME(Vaddr),
|
||||||
PR_GET_NAME(Vaddr),
|
PR_GET_NAME(Vaddr),
|
||||||
|
#[allow(dead_code)]
|
||||||
PR_SET_TIMERSLACK(u64),
|
PR_SET_TIMERSLACK(u64),
|
||||||
|
#[allow(dead_code)]
|
||||||
PR_GET_TIMERSLACK,
|
PR_GET_TIMERSLACK,
|
||||||
PR_SET_DUMPABLE(Dumpable),
|
PR_SET_DUMPABLE(Dumpable),
|
||||||
PR_GET_DUMPABLE,
|
PR_GET_DUMPABLE,
|
||||||
@ -100,7 +99,7 @@ pub enum Dumpable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PrctlCmd {
|
impl PrctlCmd {
|
||||||
fn from_args(option: i32, arg2: u64, arg3: u64, arg4: u64, arg5: u64) -> Result<PrctlCmd> {
|
fn from_args(option: i32, arg2: u64, _arg3: u64, _arg4: u64, _arg5: u64) -> Result<PrctlCmd> {
|
||||||
match option {
|
match option {
|
||||||
PR_SET_PDEATHSIG => {
|
PR_SET_PDEATHSIG => {
|
||||||
let signum = SigNum::try_from(arg2 as u8)?;
|
let signum = SigNum::try_from(arg2 as u8)?;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
use core::time::Duration;
|
use core::time::Duration;
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
@ -203,6 +201,7 @@ impl FdSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Equivalent to FD_CLR.
|
/// Equivalent to FD_CLR.
|
||||||
|
#[allow(unused)]
|
||||||
pub fn unset(&mut self, fd: FileDesc) -> Result<()> {
|
pub fn unset(&mut self, fd: FileDesc) -> Result<()> {
|
||||||
let fd = fd as usize;
|
let fd = fd as usize;
|
||||||
if fd >= FD_SETSIZE {
|
if fd >= FD_SETSIZE {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(non_camel_case_types)]
|
|
||||||
use core::time::Duration;
|
use core::time::Duration;
|
||||||
|
|
||||||
use super::SyscallReturn;
|
use super::SyscallReturn;
|
||||||
@ -12,6 +11,7 @@ use crate::{
|
|||||||
/// `ItimerType` is used to differ the target timer for some timer-related syscalls.
|
/// `ItimerType` is used to differ the target timer for some timer-related syscalls.
|
||||||
#[derive(Debug, Copy, Clone, TryFromInt, PartialEq)]
|
#[derive(Debug, Copy, Clone, TryFromInt, PartialEq)]
|
||||||
#[repr(i32)]
|
#[repr(i32)]
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
pub(super) enum ItimerType {
|
pub(super) enum ItimerType {
|
||||||
ITIMER_REAL = 0,
|
ITIMER_REAL = 0,
|
||||||
ITIMER_VIRTUAL = 1,
|
ITIMER_VIRTUAL = 1,
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
use super::SyscallReturn;
|
use super::SyscallReturn;
|
||||||
use crate::{
|
use crate::{
|
||||||
prelude::*,
|
prelude::*,
|
||||||
@ -111,5 +109,6 @@ impl From<SigStack> for stack_t {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
const SIGSTKSZ: usize = 8192;
|
const SIGSTKSZ: usize = 8192;
|
||||||
const MINSTKSZ: usize = 2048;
|
const MINSTKSZ: usize = 2048;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
use super::SyscallReturn;
|
use super::SyscallReturn;
|
||||||
use crate::{
|
use crate::{
|
||||||
fs::{
|
fs::{
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(unused_variables)]
|
|
||||||
|
|
||||||
use super::SyscallReturn;
|
use super::SyscallReturn;
|
||||||
use crate::{
|
use crate::{
|
||||||
prelude::*,
|
prelude::*,
|
||||||
@ -11,9 +9,9 @@ use crate::{
|
|||||||
pub fn sys_waitid(
|
pub fn sys_waitid(
|
||||||
which: u64,
|
which: u64,
|
||||||
upid: u64,
|
upid: u64,
|
||||||
infoq_addr: u64,
|
_infoq_addr: u64,
|
||||||
options: u64,
|
options: u64,
|
||||||
rusage_addr: u64,
|
_rusage_addr: u64,
|
||||||
) -> Result<SyscallReturn> {
|
) -> Result<SyscallReturn> {
|
||||||
// FIXME: what does infoq and rusage use for?
|
// FIXME: what does infoq and rusage use for?
|
||||||
let process_filter = ProcessFilter::from_which_and_id(which, upid);
|
let process_filter = ProcessFilter::from_which_and_id(which, upid);
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
use super::SyscallReturn;
|
use super::SyscallReturn;
|
||||||
use crate::{fs::file_table::FileDesc, prelude::*};
|
use crate::{fs::file_table::FileDesc, prelude::*};
|
||||||
|
|
||||||
const STDOUT: u64 = 1;
|
|
||||||
const STDERR: u64 = 2;
|
|
||||||
|
|
||||||
pub fn sys_write(fd: FileDesc, user_buf_ptr: Vaddr, user_buf_len: usize) -> Result<SyscallReturn> {
|
pub fn sys_write(fd: FileDesc, user_buf_ptr: Vaddr, user_buf_len: usize) -> Result<SyscallReturn> {
|
||||||
debug!(
|
debug!(
|
||||||
"fd = {}, user_buf_ptr = 0x{:x}, user_buf_len = 0x{:x}",
|
"fd = {}, user_buf_ptr = 0x{:x}, user_buf_len = 0x{:x}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user