sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * WARNING: All identifiers here must begin with an underscore. This file is sl@0: * included by stdio.h and others and we therefore must only use identifiers sl@0: * in the namespace allotted to us. sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #ifndef _REENT_H_ sl@0: #define _REENT_H_ sl@0: sl@0: sl@0: #if (defined(__SYMBIAN32__) && (defined(__WINSCW__) || defined(__WINS__))) sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #endif sl@0: sl@0: #ifdef __cplusplus sl@0: extern "C" { sl@0: #endif sl@0: sl@0: sl@0: #include <_ansi.h> sl@0: #include sl@0: sl@0: /* sl@0: struct _reent sl@0: sl@0: This structure contains *all* globals needed by the library. sl@0: It's raison d'etre is to facilitate threads by making all library routines sl@0: reentrant. sl@0: Currently only error number, which is per thread basis and sl@0: pointer to CLocalSystemInterface is stored in _reent structure. sl@0: */ sl@0: sl@0: sl@0: #define _ASCTIME_SIZE (26+8) /* 26 min, plus caution factor! */ sl@0: struct _reent sl@0: { sl@0: int _errno; /* local copy of errno */ sl@0: void *_netdb; /* used by gethostbyaddr and similar netdb functions */ sl@0: void *_memaddr; /* To hold mapped memory address during mmap syscall */ sl@0: }; sl@0: sl@0: /* sl@0: This exported API is used for fetching reent structure for TLS sl@0: */ sl@0: struct _reent* ImpurePtr (void); sl@0: sl@0: /* sl@0: Support for explicit release of all STDLIB resources belonging to this thread sl@0: */ sl@0: void CloseSTDLIB(); sl@0: sl@0: #define _REENT (ImpurePtr()) sl@0: #define __errno_r(ptr) ((ptr)->_errno) sl@0: sl@0: #ifdef __cplusplus sl@0: } sl@0: #endif sl@0: sl@0: #endif /* _REENT_H_ */