libc icon indicating copy to clipboard operation
libc copied to clipboard

Cygwin: Add PTY and group API

Open Berrysoft opened this issue 1 year ago • 3 comments

Description

Some methods required by nix crate.

Sources

  • https://github.com/cygwin/cygwin/blob/a3863bfeb73f3c3832038685498c7c4148a06890/winsup/cygwin/include/pty.h#L11-L14
  • https://github.com/cygwin/cygwin/blob/a3863bfeb73f3c3832038685498c7c4148a06890/winsup/cygwin/include/cygwin/grp.h#L19
  • https://github.com/cygwin/cygwin/blob/a3863bfeb73f3c3832038685498c7c4148a06890/newlib/libc/include/grp.h#L67-L78

Checklist

  • [ ] Relevant tests in libc-test/semver have been updated
  • [x] No placeholder or unstable values like *LAST or *MAX are included (see #3131)
  • [x] Tested locally (cd libc-test && cargo test --target mytarget); especially relevant for platforms that may not be checked in CI

Berrysoft avatar Mar 08 '25 15:03 Berrysoft

r? @tgross35

rustbot has assigned @tgross35. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot avatar Mar 08 '25 15:03 rustbot

I see forkpty and openpty defined at https://github.com/cygwin/cygwin/blob/a3863bfeb73f3c3832038685498c7c4148a06890/winsup/cygwin/include/pty.h#L11-L14 and getgrouplist at https://github.com/cygwin/cygwin/blob/a3863bfeb73f3c3832038685498c7c4148a06890/winsup/cygwin/include/cygwin/grp.h#L19, but don't see getgrgid_r and the others in the directory you linked. Is https://github.com/cygwin/cygwin/blob/a3863bfeb73f3c3832038685498c7c4148a06890/newlib/libc/include/grp.h#L67-L78 the correct source?

Assuming so, lgtm. Please update the description / commit message to say what actually changed (Nix requires a lot of things)

tgross35 avatar Mar 09 '25 23:03 tgross35

Yes, it's the correct source. I'll update the commit message later.

I tested nix by enabling --all-features.

Berrysoft avatar Mar 09 '25 23:03 Berrysoft