blob: 63951e862687a5eb642bcf6eef0c0f6464e01522 [file] [log] [blame]
Alexandre Julliard598412e2001-01-17 20:22:22 +00001/*
2 * Wine library reentrant errno support
3 *
4 * Copyright 1998 Alexandre Julliard
5 */
6
7/* Get pointers to the static errno and h_errno variables used by Xlib. This
8 must be done before including <errno.h> makes the variables invisible. */
9static int *default_errno_location(void)
10{
11 extern int errno;
12 return &errno;
13}
14
15static int *default_h_errno_location(void)
16{
17 extern int h_errno;
18 return &h_errno;
19}
20
21int* (*wine_errno_location)(void) = default_errno_location;
22int* (*wine_h_errno_location)(void) = default_h_errno_location;
23
24#include "config.h"
25
26/***********************************************************************
27 * __errno_location/__error/___errno
28 *
29 * Get the per-thread errno location.
30 */
31#ifdef ERRNO_LOCATION
32int *ERRNO_LOCATION(void)
33{
34 return wine_errno_location();
35}
36#endif /* ERRNO_LOCATION */
37
38/***********************************************************************
39 * __h_errno_location
40 *
41 * Get the per-thread h_errno location.
42 */
43int *__h_errno_location(void)
44{
45 return wine_h_errno_location();
46}