|
From: Paul F. <pj...@wa...> - 2020-04-04 13:17:50
|
Hi I'm beginning to see the light at the end of the tunnel. There's a problem with the very first client syscall, but this seems to be on the FreeBSD side. The output should be put into an array of 2 integers, the first is OK, the second is junk, and I've debugged this down to the assembler in do_syscall_WRK. So this isn't an issue with propagating the value. Getting back to my point, when I was looking at this I wondered how the syscall wrapper should be written. The problem is that the sysctl() interface has an inout pointer, oldlenp below. /* * From https://github.com/freebsd/freebsd/blob/master/sys/kern/syscalls.master * int __sysctl( ARG1 _In_reads_(namelen) int *name, ARG2 u_int namelen, ARG3 _Out_writes_bytes_opt_(*oldlenp) void *oldp, ARG4 _Inout_opt_ size_t *oldlenp, ARG5 _In_reads_bytes_opt_(newlen) const void *newp, ARG6 size_t newlen ); */ Other than handling every single sysctl (which is not very practical unless large numbers can be grouped together, there are 5484 on my system), is there any clean way to handle inout pointers? I presume that setting both PRE_MEM_READ and PRE_MEM_WRITE won't work. A+ Paul |