1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 // -*- c++ -*- 19 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 21 // O S C L _ E R R N O 22 23 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 25 /*! \addtogroup osclerror OSCL Error 26 * 27 * @{ 28 */ 29 30 31 /** \file oscl_errno.h 32 \brief Defines functions to access additional information on errors where supported through an errno or similar service. 33 */ 34 35 //! oscl_errno.h contains functions to access the global errno 36 37 #ifndef OSCL_ERRNO_H_INCLUDED 38 #define OSCL_ERRNO_H_INCLUDED 39 40 #ifndef OSCL_BASE_H_INCLUDED 41 #include "oscl_base.h" 42 #endif 43 44 #ifndef OSCLCONFIG_ERROR_H_INCLUDED 45 #include "osclconfig_error.h" 46 #endif 47 48 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 49 50 51 /*! 52 53 */ 54 //! This function determines if a particular system saves the error number that occurs on a system call 55 /*! 56 \return This method returns false on systems that do not save the 57 error number that occurs on a system call in a global variable. 58 Returns true for systems that do save the error number 59 */ 60 OSCL_IMPORT_REF bool OSCL_IsErrnoSupported(); 61 62 //! This function returns the value of the system's global error number variable 63 /*! 64 \return Returns 0 for system's that do not have this functionality 65 The value of the error number variable does not change until the user 66 calls SetLastError or if another system call occurs that changes the value 67 Supported Platforms: Win32/wince, Unix 68 Unsupported Platforms : Symbian 69 */ 70 OSCL_IMPORT_REF int OSCL_GetLastError(); 71 72 //! This function sets the last error code for the system 73 /*! 74 \param newVal This value represents the new value for the global error number 75 This method can be used to reset the error number after having retrieved it 76 using GetLastError. 77 Supported Platforms: Win32/wince, Unix 78 Unsupported Platforms : Symbian 79 */ 80 OSCL_IMPORT_REF bool OSCL_SetLastError(int newVal); 81 82 //! This function maps an error number to an error-message string. 83 /*! 84 \param errnum This value represents the error number to map 85 \return This method returns a pointer to a string containing the 86 system error-message. It returns NULL for systems that do not have 87 this functionality 88 Supported Platforms: Win32/wince, Unix 89 Unsupported Platforms : Symbian 90 */ 91 OSCL_IMPORT_REF char *OSCL_StrError(int errnum); 92 93 #if (!OSCL_DISABLE_INLINES) 94 #include "oscl_errno.inl" 95 #endif 96 97 98 #endif // INCLUDED_OSCL_ERRNO_H 99 100 /*! @} */ 101