Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/lib/csu/tests/errno/errno_test.c
48254 views
1
/*-
2
* SPDX-License-Identifier: BSD-2-Clause
3
*
4
* Copyright (c) 2025 Mark Johnston <[email protected]>
5
*/
6
7
#include <errno.h>
8
#include <stdlib.h>
9
10
static void __attribute__((constructor))
11
f(void)
12
{
13
errno = 42;
14
}
15
16
int
17
main(void)
18
{
19
/* errno must be zero upon program startup. */
20
if (errno != 0)
21
exit(1);
22
exit(0);
23
}
24
25