XCB_SELINUX_GET_WINDOW_CONTEXT_REPLY(3)

πŸ“¦
version 1.17.0 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… xcb_selinux_get_window_context β€” the XCB Requests era

okay bestie, gather round, because we're about to talk about xcb_selinux_get_window_context(3) from the XCB Requests cinematic universe and honestly? it's giving niche-but-important. no cap. πŸ¦‹


✨ NAME ✨

xcb_selinux_get_window_context β€” literally, the request that goes and gets the SELinux context for a window. that's it. that's the whole vibe. the original didn't even write a description here so we're all just standing here together in the void like πŸ§β™€οΈ


🌸 SYNOPSIS 🌸

first things first, you gotta include the header:

#include <xcb/xselinux.h>

πŸŽ€ Request function

xcb_selinux_get_window_context_cookie_t
       xcb_selinux_get_window_context(xcb_connection_t *conn,
       xcb_window_t window);

πŸŽ€ Reply datastructure

typedef struct xcb_selinux_get_window_context_reply_t {
    uint8_t  response_type;
    uint8_t  pad0;
    uint16_t sequence;
    uint32_t length;
    uint32_t context_len;
    uint8_t  pad1[20];
} xcb_selinux_get_window_context_reply_t;

πŸŽ€ Reply function

xcb_selinux_get_window_context_reply_t
       *xcb_selinux_get_window_context_reply(xcb_connection_t *conn,
       xcb_selinux_get_window_context_cookie_t cookie,
       xcb_generic_error_t **e);

πŸŽ€ Reply accessors

char *xcb_selinux_get_window_context_context(const
       xcb_selinux_get_window_context_request_t *reply);

int xcb_selinux_get_window_context_context_length(const
       xcb_selinux_get_window_context_reply_t *reply);

xcb_generic_iterator_t xcb_selinux_get_window_context_context_end(const
       xcb_selinux_get_window_context_reply_t *reply);

🌈 REQUEST ARGUMENTS 🌈

  • conn β€” your XCB connection to X11. the main character, the pipeline to the server, the whole reason we're here. πŸ’–
  • window β€” TODO: NOT YET DOCUMENTED. yeah bestie, they really just left it like that. iconic honestly. not me defending the docs team though πŸ™ˆ

πŸ’œ REPLY FIELDS πŸ’œ

  • response_type β€” the type of this reply. in this specific case it's XCB_SELINUX_GET_WINDOW_CONTEXT. this field also lives inside the xcb_generic_reply_t, so you can use it to tell your replies apart from each other when they're all stacked up like a group chat. πŸ‘‘
  • sequence β€” the sequence number of the last request processed by the X11 server. it's the receipts. keep track of it. 🧾
  • length β€” the length of the reply, measured in words. and a word, for the record, is 4 bytes. math is math. ⭐
  • context_len β€” TODO: NOT YET DOCUMENTED. once again, no thoughts, head empty, just a field name sitting there. πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

...and that's it. that's the section. it's empty. the description is a blank canvas and we are all just vibing in front of it. no notes. 🎨


πŸ’– RETURN VALUE πŸ’–

it hands you back an xcb_selinux_get_window_context_cookie_t. cute, right? a little cookie. πŸͺ

but listen β€” errors have to be handled when you call the reply function xcb_selinux_get_window_context_reply. that's the deal.

if you'd rather handle errors in the event loop instead, use xcb_selinux_get_window_context_unchecked. see xcb-requests(3) for the details, iykyk.


🚨 ERRORS 🚨

good news, bestie: this request does never generate any errors. not a single one. zero. she's unproblematic. ✨


πŸ‘€ SEE ALSO πŸ‘€

(nothing here, she's mysterious, she's aloof, she references nobody)


🫢 AUTHOR 🫢

Generated from xselinux.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. if you find a typo, tell them, not me, i'm just the messenger. πŸ’Œ


lowkey reminder: window and context_len are still marked TODO: NOT YET DOCUMENTED. so don't come for me, come for the xml. 😭

and that's a wrap, gorgeous. this page came from X Version 11, libxcb 1.17.0, and it ate, no crumbs left. periodt. πŸ’…πŸŒˆβ­