Function find [src]
Prototype
pub fn find(p: Preopens, name: []const u8) ?std.posix.fd_t
Parameters
p: Preopens
name: []const u8
Source
pub fn find(p: Preopens, name: []const u8) ?std.posix.fd_t {
for (p.names, 0..) |elem_name, i| {
if (mem.eql(u8, elem_name, name)) {
return @intCast(i);
}
}
return null;
}