<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GSS",
  "identifier" : "/documentation/GSS/gss_add_buffer_set_member(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "GSS"
    ],
    "preciseIdentifier" : "c:@F@gss_add_buffer_set_member"
  },
  "title" : "gss_add_buffer_set_member(_:_:_:)"
}
-->

# gss_add_buffer_set_member(_:_:_:)

Copies the contents of a buffer into a buffer set.

```
func gss_add_buffer_set_member(_ minor_status: UnsafeMutablePointer<OM_uint32>, _ member_buffer: gss_buffer_t, _ buffer_set: UnsafeMutablePointer<gss_buffer_set_t>) -> OM_uint32
```

## Parameters

`minor_status`

A pointer to the secondary status result that provides additional information in case of failure. Typically, a failure results from an inability to allocate memory, communicated with minor status <doc://com.apple.documentation/documentation/Foundation/POSIXError/ENOMEM>.

`member_buffer`

The buffer to copy into the buffer set.

`buffer_set`

A pointer to a buffer set descriptor reference that receives a copy of the buffer. You can indicate that the buffer set doesn’t yet exist by setting its reference to [`GSS_C_NO_BUFFER_SET`](/documentation/GSS/GSS_C_NO_BUFFER_SET). In this case, the function creates it first using [`gss_create_empty_buffer_set(_:_:)`](/documentation/GSS/gss_create_empty_buffer_set(_:_:)). In any case, the buffer is added to the end of the set, and the buffer set’s `count` parameter incremented.

## Return Value

A status code set to [`GSS_S_COMPLETE`](/documentation/GSS/GSS_S_COMPLETE) on success, or [`GSS_S_FAILURE`](/documentation/GSS/GSS_S_FAILURE) otherwise. Inspect the `minor_status` parameter for additional information on failure.

## Discussion

The function does not add the `member_buffer` to the buffer set directly. Rather it allocates new memory for a copy of the buffer, which it includes in the buffer set. When you call [`gss_release_buffer_set(_:_:)`](/documentation/GSS/gss_release_buffer_set(_:_:)) later, you deallocate the memory for the buffer set and all of its buffer copies, but this has no effect on the original `member_buffer`.

---

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)