1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/libc/inc/reent.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,81 @@
1.4 +/*
1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* WARNING: All identifiers here must begin with an underscore. This file is
1.19 +* included by stdio.h and others and we therefore must only use identifiers
1.20 +* in the namespace allotted to us.
1.21 +*
1.22 +*
1.23 +*/
1.24 +
1.25 +
1.26 +
1.27 +#ifndef _REENT_H_
1.28 +#define _REENT_H_
1.29 +
1.30 +
1.31 +#if (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__)))
1.32 +#include <time.h>
1.33 +#include <limits.h>
1.34 +#include <locale.h>
1.35 +#include <stdio.h>
1.36 +#include <wchar.h>
1.37 +#include <pthread.h>
1.38 +#endif
1.39 +
1.40 +#ifdef __cplusplus
1.41 +extern "C" {
1.42 +#endif
1.43 +
1.44 +
1.45 +#include <_ansi.h>
1.46 +#include <sys/types.h>
1.47 +
1.48 +/*
1.49 +struct _reent
1.50 +
1.51 +This structure contains *all* globals needed by the library.
1.52 +It's raison d'etre is to facilitate threads by making all library routines
1.53 +reentrant.
1.54 +Currently only error number, which is per thread basis and
1.55 +pointer to CLocalSystemInterface is stored in _reent structure.
1.56 +*/
1.57 +
1.58 +
1.59 +#define _ASCTIME_SIZE (26+8) /* 26 min, plus caution factor! */
1.60 +struct _reent
1.61 + {
1.62 + int _errno; /* local copy of errno */
1.63 + void *_netdb; /* used by gethostbyaddr and similar netdb functions */
1.64 + void *_memaddr; /* To hold mapped memory address during mmap syscall */
1.65 + };
1.66 +
1.67 +/*
1.68 +This exported API is used for fetching reent structure for TLS
1.69 +*/
1.70 +struct _reent* ImpurePtr (void);
1.71 +
1.72 +/*
1.73 +Support for explicit release of all STDLIB resources belonging to this thread
1.74 +*/
1.75 +void CloseSTDLIB();
1.76 +
1.77 +#define _REENT (ImpurePtr())
1.78 +#define __errno_r(ptr) ((ptr)->_errno)
1.79 +
1.80 +#ifdef __cplusplus
1.81 +}
1.82 +#endif
1.83 +
1.84 +#endif /* _REENT_H_ */