-: 0:Source:modperl_sys.c -: 0:Object:modperl_sys.bb -: 1:/* Copyright 2002-2004 The Apache Software Foundation -: 2: * -: 3: * Licensed under the Apache License, Version 2.0 (the "License"); -: 4: * you may not use this file except in compliance with the License. -: 5: * You may obtain a copy of the License at -: 6: * -: 7: * http://www.apache.org/licenses/LICENSE-2.0 -: 8: * -: 9: * Unless required by applicable law or agreed to in writing, software -: 10: * distributed under the License is distributed on an "AS IS" BASIS, -: 11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -: 12: * See the License for the specific language governing permissions and -: 13: * limitations under the License. -: 14: */ -: 15: -: 16:#include "modperl_largefiles.h" -: 17:#include "mod_perl.h" -: 18: -: 19:/* -: 20: * Stat_t needs flags in modperl_largefiles.h -: 21: */ -: 22:int modperl_sys_is_dir(pTHX_ SV *sv) #####: 23:{ #####: 24: Stat_t statbuf; #####: 25: STRLEN n_a; #####: 26: char *name = SvPV(sv, n_a); -: 27: #####: 28: if (PerlLIO_stat(name, &statbuf) < 0) { #####: 29: return 0; -: 30: } -: 31: #####: 32: return S_ISDIR(statbuf.st_mode); -: 33:} -: 34: -: 35:/* -: 36: * Perl does not provide this abstraction. -: 37: * APR does, but requires a pool. efforts to expose this area of apr -: 38: * failed. so we roll our own. *sigh* -: 39: */ -: 40:int modperl_sys_dlclose(void *handle) 114: 41:{ -: 42:#if defined(MP_SYS_DL_DLOPEN) -: 43:#ifdef I_DLFCN -: 44:#include -: 45:#else -: 46:#include -: 47:#include -: 48:#endif 114: 49: return dlclose(handle) == 0; -: 50:#elif defined(MP_SYS_DL_DYLD) -: 51: return NSUnLinkModule(handle, FALSE); -: 52:#elif defined(MP_SYS_DL_HPUX) -: 53:#include -: 54: shl_unload((shl_t)handle); -: 55: return 1; -: 56:#elif defined(MP_SYS_DL_WIN32) -: 57: return FreeLibrary(handle); -: 58:#elif defined(MP_SYS_DL_BEOS) -: 59: return unload_add_on(handle) < B_NO_ERROR; -: 60:#elif defined(MP_SYS_DL_DLLLOAD) -: 61: return dllfree(handle) == 0; -: 62:#elif defined(MP_SYS_DL_AIX) -: 63: return dlclose(handle) == 0; -: 64:#else -: 65:#error "modperl_sys_dlclose not defined on this platform" -: 66: return 0; -: 67:#endif -: 68:}