STRUCT FDARRAY(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

struct fdarray β€” Array of file descriptors. Yep bestie, that's the whole vibe, and this is the Kernel API Manual page for struct fdarray(9). Slay.

✨ SYNOPSIS ✨

struct fdarray {
    int nr;
    int nr_alloc;
    int nr_autogrow;
    struct pollfd *entries;
    struct priv {
      union {
        int idx;
        void *ptr;
      };
      unsigned int flags;
    } *priv;
 };

πŸŽ€ Members πŸŽ€

  • priv β€” per array entry priv area. Users should access just its contents, not set it to anything, because it is kept in synch with entries, being realloc'ed, * for instance, in fdarray__{grow,filter}. It's giving "look, don't touch" energy, fr fr.
  • {unnamed_union} β€” anonymous. That's the unnamed union moment, iykyk.

πŸ’« Description πŸ’«

I.e. using fda->priv[N].idx = * value where N < fda->nr is ok, but doing fda->priv = malloc(M) is not allowed. That's the rule, bestie β€” no cap.

πŸ”— SEE ALSO πŸ”—

  • Kernel file ./tools/lib/api/fd/array.h

πŸ’– That's the tea from ./tools/lib/api/fd, dated October 2026. Go be iconic with your file descriptor array, bestie! πŸ’…βœ¨

πŸ“¦ where this page comes from