public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ExitProcess does not work in Cygwin?
@ 2022-01-13  6:39 Jay K
  2022-01-13 13:40 ` Eliot Moss
  0 siblings, 1 reply; 8+ messages in thread
From: Jay K @ 2022-01-13  6:39 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-01-26 17:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13  6:39 ExitProcess does not work in Cygwin? Jay K
2022-01-13 13:40 ` Eliot Moss
2022-01-13 17:07   ` Kaz Kylheku (Cygwin)
2022-01-13 17:19     ` Brian Inglis
2022-01-13 23:15       ` Jay K
2022-01-14  6:19         ` Brian Inglis
2022-01-26 14:23         ` Andrey Repin
2022-01-26 17:06           ` Jay K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).