<!--
{
  "availability" : [
    "iOS: 8.0.0 - 10.0.0",
    "iPadOS: 8.0.0 - 10.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.10.0 - 10.12.0",
    "tvOS: 9.0.0 - 10.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 3.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/os_activity_get_active",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "c:@F@os_activity_get_active"
  },
  "title" : "os_activity_get_active"
}
-->

# os_activity_get_active

Returns the stack of nested activities associated with the current thread.

```
extern unsigned int os_activity_get_active(os_activity_id_t *entries, unsigned int *count);
```

## Parameters

`entries`

A buffer sized to hold the the number of activities being requested.

`count`

The number of activities requested.

## Return Value

The number of activities written to `entries`.

## Discussion

Because activities can be nested, there can be more than one activity involved on the current thread.

This function should be used only by diagnostic tools for making additional determinations about a situation.

---

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)