Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151534592
D50997.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
672 B
Referenced Files
None
Subscribers
None
D50997.diff
View Options
diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c
--- a/lib/libc/csu/libc_start1.c
+++ b/lib/libc/csu/libc_start1.c
@@ -28,6 +28,7 @@
#include <sys/param.h>
#include <sys/elf.h>
#include <sys/elf_common.h>
+#include <errno.h>
#include <stdlib.h>
#include "libc_private.h"
@@ -169,6 +170,13 @@
}
handle_static_init(argc, argv, env);
+
+ /*
+ * C17 4.3 paragraph 3:
+ * The value of errno in the initial thread is zero at program
+ * startup.
+ */
+ errno = 0;
exit(mainX(argc, argv, env));
}
@@ -194,5 +202,6 @@
monstartup(eprolp, etextp);
handle_static_init(argc, argv, env);
+ errno = 0;
exit(mainX(argc, argv, env));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 1:51 AM (20 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31187830
Default Alt Text
D50997.diff (672 B)
Attached To
Mode
D50997: csu: C standard requires errno on main() entry
Attached
Detach File
Event Timeline
Log In to Comment