WSL2

Viktor Dukhovni ietf-dane at dukhovni.org
Thu Mar 11 12:04:11 UTC 2021


> On Mar 11, 2021, at 9:41 AM, Tom Ellis <tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote:
> 
> I'm not really following the details, but is this useful to you?
> 
> % cat g.c && cc g.c -o g && ./g
> #include <sys/types.h>
> #include <grp.h>
> #include <errno.h>
> #include <stdio.h>
> 
> int main(int argc, char **argv)
> {
>    char buf[1024];
>    struct group g, *p;
>    int rc;
> 
>    errno = 0;
>    rc = getgrnam_r(argc > 1 ? argv[1] : "nosuchgrouphere",
>                    &g, buf, sizeof(buf), &p);
>    printf("%s(%p) %m(%d)\n", p ? g.gr_name : NULL, p, errno);
>    return (rc == 0 && p == NULL);
> }
> (null)((nil)) No such process(3)

Yes, it means that the reported error is not an artefact of
the Haskell "unix" package, but rather originates directly
from normal use of the getpwnam_r(3) glibc API on these
systems.

It would now be useful to also post:

  - The output of "./g root" or some other group known to exist.
  - The output of "./g xyzzy" or some other short group name known to
     not exist
  - The output of "grep group /etc/nsswitch.conf"
  - Attach an strace output file (g.trace.txt) from:

	strace -o g.trace.txt ./g

-- 
	Viktor.


More information about the ghc-devs mailing list