MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / hook_is_executable

Function hook_is_executable

src/executor/wall_time/isolation.rs:110–123  ·  view source on GitHub ↗

Whether `path` is an executable file. Used to detect machine hooks.

(path: &str)

Source from the content-addressed store, hash-verified

108
109/// Whether `path` is an executable file. Used to detect machine hooks.
110fn hook_is_executable(path: &str) -> bool {
111 #[cfg(target_os = "linux")]
112 {
113 use std::os::unix::fs::PermissionsExt;
114 std::fs::metadata(path)
115 .map(|m| m.is_file() && m.permissions().mode() & 0o111 != 0)
116 .unwrap_or(false)
117 }
118 #[cfg(not(target_os = "linux"))]
119 {
120 let _ = path;
121 false
122 }
123}
124
125/// Run a machine hook, logging (never failing the run) on error. Isolation is
126/// best-effort: a missing or failing hook leaves the benchmark less isolated, but

Callers 1

resolveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected