<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/os_security_config_get_for_proc",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "c:@F@os_security_config_get_for_proc"
  },
  "title" : "os_security_config_get_for_proc"
}
-->

# os_security_config_get_for_proc

```
extern int os_security_config_get_for_proc(pid_t pid, os_security_config_t *config);
```

## Parameters

`pid`

The process identifier (pid_t) of the target process.

`config`

A pointer to an os_security_config_t variable where the resulting security
configuration will be stored if the function succeeds. This parameter must not be NULL.

## Return Value

Returns 0 on success, in which case `*config` is populated, or -1 on failure.

## Discussion

\abstract Retrieves the security configuration bitmask for a target process, identified by its PID.
\discussion This function queries the kernel for the set of security properties
active for the specified process.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)