smp_subr.c revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * Internal routine for setting both _smp_errno and _smp_errmsg. We save 2N/A * and restore the UNIX errno across this routing so the caller can use either 2N/A * smp_set_errno(), smp_error(), or smp_verror() without this value changing. 2N/A * To allow the existing error message to itself be used in an error 2N/A * message, we put the new error message into a buffer on the stack, 2N/A * and then copy it into lsh_errmsg. We also need to set the errno, 2N/A * but because the call to smp_set_errno() is destructive to 2N/A * lsh_errmsg, we do this after we print into our temporary buffer 2N/A * (in case _smp_errmsg is part of the error message) and before we 2N/A * copy the temporary buffer on to _smp_errmsg (to prevent our new 2N/A * message from being nuked by the call to smp_set_errno()). 2N/A * Trim any leading and/or trailing spaces from the fixed-length string 2N/A * argument and return a newly-allocated copy of it. 2N/A "library version %d does not match requested version %d",