summaryrefslogtreecommitdiff
path: root/lib/libc/gen/errno.c
blob: ddbe778702a6df3d7f249d20d6b04bc87eea0f8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* PUBLIC DOMAIN: No Rights Reserved.   Marco S Hyman <marc@snafu.org> */

#if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$OpenBSD: errno.c,v 1.4 2004/07/17 20:38:43 marc Exp $";
#endif /* LIBC_SCCS and not lint */

#include <errno.h>
#undef errno

/*
 * global errno for unthreaded programs.
 */
int errno;

/*
 * weak version of function used by unthreaded programs.
 */
int *
___errno(void)
{
	return &errno;
}

__weak_alias(__errno, ___errno);