Don't issue error message if message number in application range.
[wine] / library / errno.c
1 /*
2  * Wine library reentrant errno support
3  *
4  * Copyright 1998 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "config.h"
22
23 /* default errno before threading is initialized */
24 static int *default_errno_location(void)
25 {
26     static int errno;
27     return &errno;
28 }
29
30 /* default h_errno before threading is initialized */
31 static int *default_h_errno_location(void)
32 {
33     static int h_errno;
34     return &h_errno;
35 }
36
37 int* (*wine_errno_location)(void) = default_errno_location;
38 int* (*wine_h_errno_location)(void) = default_h_errno_location;
39
40 /***********************************************************************
41  *           __errno_location/__error/___errno
42  *
43  * Get the per-thread errno location.
44  */
45 #ifdef ERRNO_LOCATION
46 int *ERRNO_LOCATION(void)
47 {
48     return wine_errno_location();
49 }
50 #endif /* ERRNO_LOCATION */
51
52 /***********************************************************************
53  *           __h_errno_location
54  *
55  * Get the per-thread h_errno location.
56  */
57 int *__h_errno_location(void)
58 {
59     return wine_h_errno_location();
60 }