Index: test.tcl ================================================================== --- test.tcl +++ test.tcl @@ -2,13 +2,18 @@ puts [exec ./build-dyn.sh] load ./tuapi.so -::tuapi::modprobe /dev/fuse +::tuapi::modprobe pci:v000014E4d0000164Csv00001028sd000001B3bc03sc00i00 -::tuapi::syscall::tsmf_start_svc blah /bin/true /tmp/logfile [list PATH=/bin] / 022 0 0 10 +#foreach x [list AS CORE CPU DATA FSIZE LOCKS MEMLOCK MSGQUEUE NICE NOFILE OFILE NPROC RSS RTPRIO RTTIME SIGPENDING STACK] { +# puts "\t\tcase [format 0x%xLU [::tuapi::internal::hash $x]]: /* $x */" +# puts "\t\t\tresource_id = RLIMIT_$x;" +# puts "\t\t\tbreak;" +#} +#exit foreach iface [tuapi::syscall::ifconfig] { #lo0:2: flags=2001000849 mtu 8232 index 1 # inet 127.0.0.1 netmask ff000000 #aggr100003:1: flags=201000843 mtu 1500 index 2 Index: tuapi.tcl ================================================================== --- tuapi.tcl +++ tuapi.tcl @@ -320,10 +320,13 @@ ::tuapi::helper::foreach_line $fd " " { set alias [lindex $line 1] set module [lindex $line 2] set alias2module($alias) $module + if {[string match {*\**} $alias]} { + set alias2module_wildcards($alias) $module + } } close $fd # Load dependencies set deps_file [file join $modules_dir modules.dep] @@ -349,11 +352,25 @@ # Load modules foreach modules $args { foreach module $modules { for {set try 0} {$try < 100} {incr try} { if {![info exists alias2module($module)]} { - break + # If no exact match found, process wildcard entries + set found_wildcard_match 0 + foreach alias [array name alias2module_wildcards] { + if {[string match $alias $module]} { + set module $alias2module_wildcards($alias) + + set found_wildcard_match 1 + + break + } + } + + if {!$found_wildcard_match} { + break + } } set module $alias2module($module) }