1

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"
    <key>OSBundleLibraries</key>
    <dict>
        <key>com.apple.kpi.bsd</key>
        <string>14.0.0</string>
        <key>com.apple.kpi.iokit</key>
        <string>14.0.0</string>
        <key>com.apple.kpi.libkern</key>
        <string>14.0.0</string>
        <key>com.apple.kpi.mach</key>
        <string>14.0.0</string>
        <key>com.apple.kpi.unsupported</key>
        <string>14.0.0</string>
    </dict>

I would expect that task_policy_get is a usable KPI? Can somebody point me in the right direction?

  • 11.3 Beta (20E5210c)
  • Mac mini (M1, 2020)

What I am actually wanting to do is to temporarily increase the quality of service (qos) values for a process. Maybe there is a better way of doing this?

dmaclach
  • 3,403
  • 1
  • 21
  • 23

1 Answers1

1

task_policy_get is a MIG interface to be called from user space. It's not listed in any .exports files in the XNU source tree, not even Private.exports, so it's not intended for calling from a kext.

pmdj
  • 22,018
  • 3
  • 52
  • 103