Post

Replies

Boosts

Views

Activity

FSKit - Documentation? Examples?
Looking for any more documentation on FSKit - https://developer.apple.com/documentation/fskit?language=objc I don't see any examples or sessions on it, but it looks fascinating. Attempted to try to put something together and immediately ran into failed at lookup with error 159 - Sandbox restriction
2
1
898
Jun ’24
`kmutil showloaded` shows address of 0
We have a KEXT that lists an address of 0 when we run kmutil showloaded on Apple Silicon (M1 & M2). The KEXT appears to work fine, but we are concerned that we have something misconfigured. It shows a proper address on x86_64. Any thoughts would be appreciated. macOS 13.4. Cheers, Dave ... 252 0 0xfffffe00078461f0 0x998 0x998 com.apple.driver.driverkit.serial (6.0.0) 447C62ED-B7E8-3B91-A3B1-19D2B50A20EC <46 5 4 3 1> 254 0 0xfffffe0007918e30 0x1710 0x1710 com.apple.filesystems.autofs (3.0) 7FF20081-54D5-329E-AA76-6BD3018C3167 <210 7 6 5 4 3 2 1> 256 0 0 0x1976 0x1976 com.google...
0
1
833
Apr ’23
si_pid and si_uid not set in sigaction handler
My understanding of sigaction is that my signal handler function should get a siginfo_t argument with the pid and uid of the process sending the signal. #include &lt;stdatomic.h&gt; #include &lt;signal.h&gt; #include &lt;stdio.h&gt; #include &lt;unistd.h&gt; #include &lt;stdlib.h&gt; static atomic_int gTermParentPid = -1; static void SigTermHandler(int signalValue, siginfo_t *info, void *uap) { gTermParentPid = info-&gt;si_pid; } int main(int argc, const char * argv[]) { struct sigaction handlerAction; handlerAction.sa_sigaction = SigTermHandler; handlerAction.sa_flags = SA_SIGINFO; sigemptyset(&amp;handlerAction.sa_mask); if (sigaction(SIGTERM, &amp;handlerAction, NULL) != 0) { perror(NULL); abort(); } printf("pid: %d\n", getpid()); while (gTermParentPid == -1) { sleep(1); } printf("ParentPid: %d\n", gTermParentPid); } so when I run the above program and then send it a kill from another shell I would expect it to log the pid of the shell I sent the kill from. In all cases though I am getting a pid and uid of 0. Is this expected? This seems to work fine on linux. I tested this with a variety of other signals (SIGALRM, SIGINT) with the same results. Not sure if Exception Handling was the right tag, but it was the closest I could find. Filed as FB11850436 as well.
2
0
1k
Dec ’22
task_policy_get not available?
I'm attempting to use task_policy_get from a KEXT and am receiving the following error: sudo /usr/bin/kmutil load -p myKext Error Domain=KMErrorDomain Code=31 "Error occurred while building a collection:    1: One or more binaries has an error which prevented linking. See other errors.   2: Could not use 'myKext' because: Failed to bind '_task_policy_get' in 'myKext' (at offset 0x320 in __DATA_CONST, __got) as could not find a kext which exports this symbol" I would expect that task_policy_get is a usable KPI? 11.3 Beta (20E5210c) Mac mini (M1, 2020) What I am actually wanting to do is to temporarily increase the qos values for a process. Maybe there is a better way of doing this?
8
0
1.2k
Apr ’21