ExitProcess does not work in Cygwin?

Jay K jayk123@hotmail.com
Thu Jan 13 06:39:01 GMT 2022


ExitProcess does not work in Cygwin?
$ rm *.exe
# u is for Unix
# w is for Windows
$ cat u.c
#include <stdlib.h>
int main()
{
 exit(1);
}
$ gcc u.c
$ ./a.exe
$ echo $?
1
 => as expected
$ cat w.c
#include <windows.h>
int main()
{
 ExitProcess(1);
}
$ gcc w.c
$ ./a.exe
$ echo $?
0
 => not expected
$ uname -a
CYGWIN_NT-10.0 jayk-tp4 3.3.3(0.341/5/3) 2021年12月03日 16:35 x86_64 Cygwin
works in debugger:
$ /cygdrive/c/bin/amd64/windbg.exe .\\a.exe
$ echo $?
1
?
 - Jay


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /