ls but with io_uring

Fix crash with --long on macos #8

merged
opened by reykjalin.org targeting main

It turns out macOS does several things that go against the assumptions currently built into lsr:

  1. The /etc/passwd file has an extensive comment at the top of the file; several lines starting with #.
  2. macOS (and apparently some other operating systems) allow negative uids and gids.

So, the changes here:

  1. Allow for comments in /etc/passwd; and
  2. Use i33 instead of u32, posix.uid_t and posix.gid_t when parsing and using uids and gids.
0
by reykjalin.org 2 comments

I chose i33 here just so we wouldn't have to include a comptime if/else check everywhere we're doing something with a uid or gid. Since u32 fits into i33 things just seemlessly work.

I don't think the structs are packed, so maybe we should bump this up to i64? Don't know what makes the most sense here, but i33 seems pretty good so far.

Thanks for the fixes! I think sticking with i33 is the right call.

pull request successfully merged
sign up or login to add to the discussion
Labels

None yet.

Participants 2
AT URI
at://did:plc:ph2n2oeirk7t5zjmxwfkhojk/sh.tangled.repo.pull/3lopi2qdbog22