• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

olukowski / celer / 24930865087

25 Apr 2026 12:25PM UTC coverage: 99.677% (-0.3%) from 100.0%
24930865087

Pull #10

github

web-flow
Merge 4671e3217 into ea5776c23
Pull Request #10: feat(syscalls): thin wrappers around raw syscalls

10 of 10 branches covered (100.0%)

Branch coverage included in aggregate %.

1704 of 1712 new or added lines in 118 files covered. (99.53%)

2462 of 2470 relevant lines covered (99.68%)

11.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.56
/system/linux/syscalls/src/setup.rs
1
use celer_system_linux_ctypes::Void;
2

3
use crate::errno::Errno;
4
use crate::helpers::unit_from_ret;
5
use crate::sys;
6

7
/// Errors returned by [`setup`].
8
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
9
pub enum SetupError {
10
    Eperm,
11
    Other(Errno),
12
}
13

14
impl SetupError {
15
    fn from_errno(errno: Errno) -> Self {
2✔
16
        match errno {
2✔
17
            Errno::Eperm => Self::Eperm,
1✔
18
            errno => Self::Other(errno),
1✔
19
        }
20
    }
2✔
21
}
22

23
/// Run the historical Linux 1.0 bootstrap-only `setup` syscall.
24
///
25
/// This safe wrapper maps the raw Linux 1.0 return into
26
/// `Result<(), SetupError>`.
27
///
28
/// See [`sys::linux_1_0::setup`] for kernel behavior, reachable errors, and
29
/// source references.
30
///
31
/// # Errors
32
/// - [`SetupError::Eperm`]: Linux 1.0 returned literal `-1` when the one-shot
33
///   guard rejected a repeated call.
34
/// - [`SetupError::Other`]: any other errno-shaped raw return.
35
#[cfg(target_arch = "x86")]
NEW
36
pub fn setup(bios: *mut Void) -> Result<(), SetupError> {
×
NEW
37
    let ret = sys::linux_1_0::setup(bios);
×
NEW
38
    unit_from_ret(ret as isize, SetupError::from_errno)
×
NEW
39
}
×
40

41
#[cfg(test)]
42
#[cfg_attr(coverage_nightly, coverage(off))]
43
mod tests {
44
    use crate::Errno;
45

46
    use super::SetupError;
47

48
    #[test]
49
    fn test_setup_error_mapping() {
50
        assert_eq!(SetupError::from_errno(Errno::Eperm), SetupError::Eperm);
51
        assert_eq!(
52
            SetupError::from_errno(Errno::Eio),
53
            SetupError::Other(Errno::Eio)
54
        );
55
    }
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc