Changeset 3601 for trunk/kStuff/kLdr/kLdrDyldFind.c
- Timestamp:
- Oct 29, 2007, 1:21:13 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kStuff/kLdr/kLdrDyldFind.c
r3598 r3601 1 1 /* $Id$ */ 2 2 /** @file 3 *4 3 * kLdr - The Dynamic Loader, File Searching Methods. 5 * 6 * Copyright (c) 2006 knut st. osmundsen <bird-kbuild-src@anduin.net> 7 * 8 * 9 * This file is part of kLdr. 10 * 11 * kLdr is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * kLdr is distributed in the hope that it will be useful, 4 */ 5 6 /* 7 * Copyright (c) 2006-2007 knut st. osmundsen <bird-kStuff-spam@anduin.net> 8 * 9 * This file is part of kStuff. 10 * 11 * kStuff is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU Lesser General Public 13 * License as published by the Free Software Foundation; either 14 * version 2.1 of the License, or (at your option) any later version. 15 * 16 * In addition to the permissions in the GNU Lesser General Public 17 * License, you are granted unlimited permission to link the compiled 18 * version of this file into combinations with other programs, and to 19 * distribute those combinations without any restriction coming from 20 * the use of this file. 21 * 22 * kStuff is distributed in the hope that it will be useful, 17 23 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with kLdr; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * 25 */ 26 27 24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25 * Lesser General Public License for more details. 26 * 27 * You should have received a copy of the GNU Lesser General Public 28 * License along with kStuff; if not, write to the Free Software 29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 30 * 02110-1301, USA 31 */ 28 32 29 33 /******************************************************************************* … … 33 37 #include "kLdrInternal.h" 34 38 35 #if K_OS == K_OS_OS2 39 #if K_OS == K_OS_LINUX 40 # include <k/kHlpSys.h> 41 42 #elif K_OS == K_OS_OS2 36 43 # define INCL_BASE 37 44 # define INCL_ERRORS … … 309 316 kLdrDyldWindowsAppDir[1] = kLdrDyldAppDir[1] = '\0'; 310 317 318 #elif K_OS == K_OS_LINUX 319 KSSIZE cch = kHlpSys_readlink("/proc/self/exe", kLdrDyldAppDir, sizeof(kLdrDyldAppDir) - 1); 320 if (cch > 0) 321 { 322 kLdrDyldAppDir[cch] = '\0'; 323 *kHlpGetFilename(kLdrDyldAppDir) = '\0'; 324 kHlpMemCopy(kLdrDyldWindowsAppDir, kLdrDyldAppDir, sizeof(kLdrDyldAppDir)); 325 } 326 else 327 { 328 kLdrDyldWindowsAppDir[0] = kLdrDyldAppDir[0] = '.'; 329 kLdrDyldWindowsAppDir[1] = kLdrDyldAppDir[1] = '\0'; 330 } 331 311 332 #elif K_OS == K_OS_OS2 312 333 PPIB pPib; … … 326 347 kLdrDyldWindowsAppDir[1] = kLdrDyldAppDir[1] = '\0'; 327 348 } 328 329 349 330 350 #elif K_OS == K_OS_WINDOWS … … 799 819 /** @todo *penmSearch = KLDRDYLD_SEARCH_DARWIN; */ 800 820 *penmSearch = KLDRDYLD_SEARCH_UNIX_COMMON; 821 #elif K_OS == K_OS_FREEBSD \ 822 || K_OS == K_OS_LINUX \ 823 || K_OS == K_OS_NETBSD \ 824 || K_OS == K_OS_OPENBSD \ 825 || K_OS == K_OS_SOLARIS 826 *penmSearch = KLDRDYLD_SEARCH_UNIX_COMMON; 801 827 #elif K_OS == K_OS_OS2 802 828 *penmSearch = KLDRDYLD_SEARCH_OS2;
Note:
See TracChangeset
for help on using the changeset viewer.