On 64-bit Windows, pid_t needs to be 64-bit large, i.e. intptr_t or 'long long' or '__int64'. This is because the return type of _spawnv* (when invoked with _P_NOWAIT) and the argument of the _cwait function are 'intptr_t' (see [1][2]: "The return value from an asynchronous _spawnvp or _wspawnvp (_P_NOWAIT or _P_NOWAITO specified for mode) is the process handle." On mingw, this is already the case. But on MSVC (and MSVC/clang), the 'pid_t' type is nowhere defined. In this case, gnulib defines it through config.h. [1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnvp-wspawnvp [2] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/cwait 2020-08-23 Bruno Haible tests: Don't assume that pid_t fits in an 'int'. * tests/test-nonblocking-pipe-main.c (main): Use type 'pid_t' instead of 'int'. * tests/test-nonblocking-socket-main.c (main): Likewise. sys_types: Fix definition of pid_t on 64-bit MSVC. * m4/pid_t.m4: New file. * modules/sys_types (Files): Add it. * modules/dirent (Files): Likewise. * modules/fcntl-h (Files): Likewise. * modules/sched (Files): Likewise. * modules/signal-h (Files): Likewise. * modules/spawn (Files): Likewise. * modules/sys_stat (Files): Likewise. * modules/sys_wait (Files): Likewise. * modules/termios (Files): Likewise. * modules/unistd (Files): Likewise.