0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2000-2002, 2004, 2005, 2007, 2011-2013, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * Convert a POSIX errno value into an isc_result_t. The
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * list of supported errno values is not complete; new users
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * of this function should add any expected errors that are
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * not already there.
f5898cf3484b1588d5239faa4062a2b2b606ce91Evan Huntisc___errno2result(int posixerrno, isc_boolean_t dolog,
1ab0c9558f167cac2fc6a486547334d56930b81eDavid Lawrence case EINVAL: /* XXX sometimes this is not for files */
f5898cf3484b1588d5239faa4062a2b2b606ce91Evan Hunt isc__strerror(posixerrno, strbuf, sizeof(strbuf));
f5898cf3484b1588d5239faa4062a2b2b606ce91Evan Hunt UNEXPECTED_ERROR(file, line, "unable to convert errno "
f5898cf3484b1588d5239faa4062a2b2b606ce91Evan Hunt "to isc_result: %d: %s",
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * XXXDCL would be nice if perhaps this function could
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * return the system's error string, so the caller
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * might have something more descriptive than "unexpected
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * error" to log with.