Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: srand(0) Date: Wed, 31 Dec 2025 16:34:44 -0800 Organization: None to speak of Lines: 29 Message-ID: <87cy3uuq57.fsf@example.invalid> References: <10ib0ka$3cgil$1@dont-email.me> <10icocl$3u4ua$1@dont-email.me> <10idg5m$3k87$3@dont-email.me> <20251224105114.0000714b@yahoo.com> <10ih0qo$13hnn$2@dont-email.me> <20251224174452.00003278@yahoo.com> <10ih3lu$13hnn$5@dont-email.me> <10ih5r2$25ihh$5@dont-email.me> <10iiell$1kfhj$1@dont-email.me> <10iirh8$25ihh$6@dont-email.me> <10ilfqp$2fs21$1@dont-email.me> <10ivq6b$1j8r3$1@dont-email.me> <10j206j$27s3j$1@dont-email.me> <87jyy3wcgf.fsf@example.invalid> <20251231151502.00002c3e@yahoo.com> <877bu2w92v.fsf@example.invalid> <20260101014548.000012eb@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 01 Jan 2026 00:34:45 +0000 (UTC) Injection-Info: dont-email.me; posting-host="33b043e89e5f39dc06c7cc358565192e"; logging-data="3106480"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KwdT1ZnXga81A/JeB6/wW" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:dkgtNG6xffVzmnwwK5wXQG4BDI4= sha1:vJYwlQr55HzqvheXH7+nuO3tsRs= Xref: csiph.com comp.lang.c:396050 Michael S writes: > On Wed, 31 Dec 2025 15:00:24 -0800 > Keith Thompson wrote: [...] >> If I were going to look into the behavior on Windows, I'd probably >> want to use Windows native features. (I tried my test on Cygwin, >> and the callee wasn't invoked.) > > That's likely because under Windows callee is named callee.exe. > I didn't try on cygwin, but that was the reason of failure under msys2. > Also, I am not sure if slash in the name is allowed. May be, backslash > is required. No, that's definitely not it. Cygwin emulates a Unix-like system on top of Windows. It creates executables with a ".exe" suffix, but plays some tricks so that "foo.exe" also looks like "foo". Also, Cygwin uses "/" as a directory separator. When I modified the caller program to set argv[0], it worked correctly. I've updated the caller to show the result of execve() (which normally doesn't return). It returns -1 to indicate an error and sets errno to 7 (E2BIG, Argument list too long) -- which is a bit odd, but there's no E2SMALL code. [...] -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */