cinap made some improvements that are worth adopting. i'm redfaced that i saw tsemacquire, but missed semacquire and semrelease. additionally, move the arches into a list and don't use patter matching. we want exactly "seek" and "_SEEK". Reference: /n/atom/patch/applied/truss64redux Date: Sun Feb 16 13:56:17 CET 2014 Signed-off-by: quanstro@quanstro.net --- /sys/lib/acid/syscall Sun Feb 16 13:51:26 2014 +++ /sys/lib/acid/syscall Sun Feb 16 13:51:27 2014 @@ -121,6 +121,8 @@ {34, {"rendezvous", "AA", code(*sysrendezvous:list)}}, {35, {"unmount", "ss", code(*sysunmount:list)}}, {36, {"_wait", "A", code(*sys_wait:list)}}, + {37, {"semacquire", "AD", code(*syssemacquire:list)}}, + {38, {"semrelease", "AD", code(*syssemrelease:list)}}, {39, {"seek", "ADVD", code(*sysseek:list)}}, {40, {"fversion", "DDsD", code(*sysfversion:list)}}, {41, {"errstr", "TD", code(*syserrstr:list)}}, --- /sys/lib/acid/truss Sun Feb 16 13:51:28 2014 +++ /sys/lib/acid/truss Sun Feb 16 13:51:28 2014 @@ -74,6 +74,8 @@ "brk_", "remove", "_wstat", + "semacquire", + "semrelease", "_fwstat", "notify", "noted", @@ -126,6 +128,8 @@ "_BRK_", "_REMOVE", "__WSTAT", + "_SEMACQUIRE", + "_SEMRELEASE", "__FWSTAT", "_NOTIFY", "_NOTED", @@ -150,11 +154,20 @@ "_TSEMACQUIRE", }; +seekhackarch = { + "alpha", + "amd64", + "arm64", + "power64", +}; + defn addressof(pattern) { // translate to ape system calls if we have an ape binary - if _addressof("_EXITS") == 0 then - return _addressof(pattern); - return _addressof(trussapecalls[match(pattern, trusscalls)]); + if _addressof("_EXITS") != 0 then + pattern = trussapecalls[match(pattern, trusscalls)]; + if (pattern == "seek" || pattern == "_SEEK") && match(objtype, seekhackarch) >= 0 then + pattern = "_" + pattern; + return _addressof(pattern); } defn setuptruss() { @@ -167,8 +180,6 @@ { name = head lst; lst = tail lst; - if name == "seek" && (objtype=="amd64" || objtype == "power64" || objtype == "alpha") then - name = "_seek"; addr = addressof(name); if addr then {