I see it defined as an enum. Is this the right way to get at NAME_MAX which is typicaly 255 for linux.
I also see in the code that NAME_MAX to what I think is libc NAME_MAX
/// Maximum number of bytes in a filename (not including the terminating
/// null of a filename string).
NAME_MAX = libc::_PC_NAME_MAX,
Yet I run into
if (file_bytes.len() as i32 > nix::unistd::PathconfVar::NAME_MAX) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found enum `nix::unistd::PathconfVar`
If I try to type cast it as
if (file_bytes.len() as i32 > nix::unistd::PathconfVar::NAME_MAX as i32) {
It compiles, it seems translate to 3, instead of 255 that I expect.