00001 /* 00002 * Copyright (C) 1991-9 Eric M. Hopper <hopper@omnifarious.mn.org> 00003 * 00004 * This program is free software; you can redistribute it and/or modify it 00005 * under the terms of the GNU Lesser General Public License as published 00006 * by the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, but 00010 * WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 /* $Header: /home/hopper/src/cvs/C++/UniEvent/UNIXError.cxx,v 1.8 2002/08/30 23:58:11 hopper Exp $ */ 00020 00021 // For log, see ChangeLog 00022 00023 #ifdef __GNUG__ 00024 # pragma implementation "UNIXError.h" 00025 #endif 00026 00027 #include "UniEvent/UNIXError.h" 00028 #include <cstring> 00029 #include <cstddef> 00030 00031 //extern "C" char *strerror_r (int __errnum, char *__buf, size_t __buflen); 00032 00033 namespace strmod { 00034 namespace unievent { 00035 00036 const UNIXError UNIXError::S_noerror("<no error>", 0, LCoreError("<no error>")); 00037 00038 void UNIXError::getErrorString(char *buf, size_t buflen) const throw () 00039 { 00040 strncpy(buf, strerror(errnum_), buflen - 1); 00041 // strerror_r(errnum_, buf, buflen); // Doesn't work right for now. 00042 buf[buflen - 1] = '\0'; 00043 } 00044 00045 }; 00046 };
1.3-rc1