tkernel_2/kernel/sysinit/src/gsyscnf.c | bare source | permlink (0.01 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T-Kernel 2.0 Software Package 4: * 5: * Copyright 2011 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17. 10: * Modified by T-Engine Forum at 2013/02/26. 11: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01. 12: * 13: *---------------------------------------------------------------------- 14: */ 15: 16: /* 17: * gsyscnf.c (sysinit) 18: * SYSCONF access utilities 19: */ 20: 21: #include "sysinit.h" 22: #include <sys/util.h> 23: #include <sys/sysinfo.h> 24: #include <libstr.h> 25: #define SysConfPtr (SCInfo.sysconf) 26: 27: /* Defined in T-Kernel/SM as internal functions */ 28: IMPORT INT getcfn( CONST UB *conf, CONST UB *name, INT *val, INT max ); 29: IMPORT INT getcfs( CONST UB *conf, CONST UB *name, UB *bp, INT max ); 30: 31: 32: EXPORT W GetSysConf(UB *name, W *val) 33: { 34: return getcfn(SysConfPtr, name, (INT*)val, L_SYSCONF_VAL); 35: } 36: 37: EXPORT W GetSysConfStr(UB *name, UB *str) 38: { 39: return getcfs(SysConfPtr, name, str, L_SYSCONF_STR); 40: }