xcb_shm_create_segment(3)
π NAME π
xcb_shm_create_segment β bestie, this one literally asks the server to allocate a shared memory segment for you π«Ά
β¨ SYNOPSIS β¨
#include <xcb/shm.h>
π Request function
xcb_shm_create_segment_cookie_t
xcb_shm_create_segment(xcb_connection_t *conn,
xcb_shm_seg_t shmseg, uint32_t size, uint8_t read_only);
π¦ Reply datastructure
typedef struct xcb_shm_create_segment_reply_t {
uint8_t response_type;
uint8_t nfd;
uint16_t sequence;
uint32_t length;
uint8_t pad0[24];
} xcb_shm_create_segment_reply_t;
πΈ Reply function
xcb_shm_create_segment_reply_t
*xcb_shm_create_segment_reply(xcb_connection_t *conn,
xcb_shm_create_segment_cookie_t cookie, xcb_generic_error_t **e);
π REQUEST ARGUMENTS π
connβ the XCB connection to X11, obvs. your lil hotline to the server πshmsegβ a shared memory segment ID that you made withxcb_generate_id(). gotta generate it first, no skipping steps bestie β¨sizeβ how big the segment you're creating should be. the size, the moment, the everything πread_onlyβTrueif the server should map the segment read-only; otherwisefalse. so like... can the server touch it or just look respectfully π
π REPLY FIELDS π
response_typeβ the type of this reply, which in this case isXCB_SHM_CREATE_SEGMENT. this field also lives in thexcb_generic_reply_tand it's how you tell your replies apart from each other, iykyk π·οΈsequenceβ the sequence number of the last request the X11 server processed π’lengthβ the length of the reply, in words. and a word is 4 bytes, periodt πnfdβ the number of file descriptors sent by the server. it will always be1. no cap, always one π€shm_fdβTODO: NOT YET DOCUMENTED.the docs simply have not caught up yet, we love an unfinished icon π
π DESCRIPTION π
It asks the server to allocate a shared memory segment. and the server's reply? it will include a file descriptor for the client to pass to mmap(). that's the whole point, that's the moment, that's the vibe π§
π₯ RETURN VALUE π₯
It returns an xcb_shm_create_segment_cookie_t. errors have to be handled when you call the reply function xcb_shm_create_segment_reply. so don't just ghost the cookie, bestie π
If you'd rather handle errors in the event loop instead, use xcb_shm_create_segment_unchecked. see xcb-requests(3) for the details on that whole situation.
π ERRORS π
This request does never generate any errors. zero. none. she's chill like that π
π«Ά SEE ALSO π«Ά
π AUTHOR π
Generated from shm.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. they're literally asking for your feedback, so slay β¨
okay that's the whole page, you ate that π
this was xcb_shm_create_segment(3), part of libxcb 1.17.0 from X Version 11 β mwah, go mmap something iconic πβ¨π
π¦ where this page comes from
- alpine 3.22: libxcb-doc 1.17.0-r0 Β· MIT
- alpine 3.23: libxcb-doc 1.17.0-r1 Β· MIT
- alpine 3.24: libxcb-doc 1.17.0-r2 Β· MIT
- arch rolling: libxcb 1.17.0-1 Β· X11
- centos-stream 10: libxcb-devel 1.17.0-3.el10 Β· X11
- debian trixie: libxcb-doc 1.17.0-2
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 43: libxcb-devel 1.17.0-6.fc43 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- fedora 44: libxcb-devel 1.17.0-7.fc44 Β· X11
- nixpkgs unstable: libxcb 1.17.0
- opensuse-leap 16.0: libxcb-devel-doc 1.17.0-160000.2.2 Β· MIT
- ubuntu questing: libxcb-doc 1.17.0-2build1
- ubuntu resolute: libxcb-doc 1.17.0-2ubuntu1
- ubuntu stonking: libxcb-doc 1.17.0-2ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms