On Tue, 1 Jun 2021 at 11:08, Chavdar Ivanov <ci4ic4%gmail.com@localhost> wrote:
Fails under FreeBSD 13 as well:
root@f13:~xci # touch foo.txt
root@f13:~xci # cc -o s s.c
root@f13:~xci # ./s
fd = 3
new_fd = -1
root@f13:~xci # uname -a
FreeBSD f13 13.0-RELEASE FreeBSD 13.0-RELEASE #0
releng/13.0-n244733-ea31abc261f: Fri Apr 9 04:24:09 UTC 2021
root%releng1.nyi.freebsd.org@localhost:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64
And under OpenBSD likewise:
o64q$ gcc -o s s.c
/tmp//ccoGvFqD.o: In function `main':
s.c:(.text+0x6a): warning: sprintf() is often misused, please use snprintf()
o64q$ touch foo.txt
o64q$ ./s
fd = 3
new_fd = -1
o64q$ uname -a
OpenBSD o64q.lorien.lan 6.4 GENERIC.MP#2 amd64
So there is a theme, I guess...