2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 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 2004 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * It is possible that we have a single file name, 2N/A * in which case the subseqent loop will do nothing 2N/A "apptrace: %s: %s\n"),
2N/A "apptrace: dlopen on %s failed: %s\n"),
2N/A /* OK, so now add it to the end of the list */ 2N/A * Called abibasename() to avoid clash with basename(3C) 2N/A * Incidentally, basename(3C) is destructive which is why 2N/A * we are not using it instead. 2N/A /* Lose the dirname */ 2N/A /* Lose the suffix */ 2N/A /* Duplicate the path */ 2N/A /* Find the last slash, if there ain't one bug out */ 2N/A * Wack the slash to a null byte. 2N/A * p now points to /A/B/C 2N/A * As above except that in LP64 (for sparc) we'll get: 2N/A * thus p now points to: 2N/A * so we repeat the wack so that we get: 2N/A * and retain a pointer, m, to the machine dependent portion. 2N/A * Now we can build a path name. 2N/A * This path is only a guess that'll be checked later in appendlist(). 2N/A * Some system libraries, like libc.so.1, reside in /lib while their 2N/A * corresponding abi_* counterparts reside in /usr/lib. The same is 2N/A * the file in the direct path name we generate exists, and if not, 2N/A * we prepend "/usr" to it. This handles all existing cases.