Skip to content

Instantly share code, notes, and snippets.

@mgood7123
Created November 30, 2022 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgood7123/d6663b7113fd77a38b6ec68ce6a6e3f6 to your computer and use it in GitHub Desktop.
Save mgood7123/d6663b7113fd77a38b6ec68ce6a6e3f6 to your computer and use it in GitHub Desktop.
struct wl_ring_buffer * buffer = &connection->fds_out;
size_t size_in_bytes = ring_buffer_size(buffer);
size_t max_fds_in_bytes = MAX_FDS_OUT * sizeof(FD_HANDLE_T);
if (size_in_bytes > max_fds_in_bytes)
size_in_bytes = max_fds_in_bytes;
if (size_in_bytes > 0) {
FD_HANDLE_T * array = buffer->data + buffer->head;
size_t array_len = size_in_bytes / sizeof(FD_HANDLE_T);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment