Based on an answer by Randy Howard, I had a look at the XNU source code for this. The file syscalls.master
has the list of all syscalls. That file describes the signature of psynch_cvwait
like this:
uint32_t
psynch_cvwait(
user_addr_t cv,
uint64_t cvlsgen,
uint32_t cvugen,
user_addr_t mutex,
uint64_t mugen,
uint32_t flags,
int64_t sec,
uint32_t nsec)
which doesn't appear to have much resemblance with the dtruss
output quoted in the question. The actual implementation in pthread_support.c
is more useful, though:
/*
* psynch_cvwait: This system call is used for psynch cvar waiters to block in kernel.
*/
int
psynch_cvwait(__unused proc_t p,
struct psynch_cvwait_args * uap,
uint32_t * retval)
This at least gives an idea as to what the arguments printed by dtruss
are. Looks as if the second one might be a structure, its members descibed by the syscalls.master
file. So the address would be of little use, and the actual members apparently aren't printed by dtruss at all. Tweaking dtruss
it might perhaps be possible to get at the members of that structure, although I'm far from sure on this account, and wonder why noone has done so yet.
I've been less lucky in trying to associate any meaning at all with that Err#316
output. Even grepping the whole XNU source code both for the decimal and the hexadecimal representation of 316, I found no occurrence which didn't include other digits as well. The error code certainly isn't mentioned in the implementation of psynch_cvwait
itself, but that implementation does forward error codes from other functions it calls. One would really need a kernel debugger to untangle that and trace the actual source of that value.
On the whole I'm now a very small step closer to understanding the dtruss
output, but with a lot of work. So a proper reference document and any insight into the source of that error code would still be very much appreciated.