FileFd
Description
Return the underlying fd. POSIX-only; on Windows this returns -1. Useful for syscalls that need a raw fd (e.g. isatty checks).
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Io.c:765:
Str buffer = StrInit(&scratch);
i32 fd = FileFd(file);
// Probe seekability: if FileSeek(0, CUR) succeeds, the underlying
- In
File.c:342:
}
i32 FileFd(const File *f) {
#ifdef _WIN32
(void)f;
Last updated on