xcb_shm_attach(3)
π xcb_shm_attach β the xcb_shm_attach(3) page, but make it make sense
okay bestie, so this is a page from the XCB Requests corner of the libxcb universe, and today we're attaching System V shared memory segments. yes really. it's giving very "low-level but make it fashion" π
β¨ NAME β¨
xcb_shm_attach β attach a System V shared memory segment. that's it, that's the whole job π«Ά
πΈ SYNOPSIS πΈ
first things first, you gotta let the compiler know what's up:
#include <xcb/shm.h>
π Request function π
xcb_void_cookie_t xcb_shm_attach(xcb_connection_t *conn,
xcb_shm_seg_t shmseg, uint32_t shmid, uint8_t read_only);
look at her. four args, one cookie, zero drama (allegedly) β¨
π¦ REQUEST ARGUMENTS π¦
here's who's who in this little friend group:
connβ the XCB connection to X11. your whole link to the server, your main character, your ride or die.shmsegβ a shared memory segment ID that you made withxcb_generate_id(). you gotta make it yourself, bestie, it's not gonna appear out of thin air.shmidβ the System V shared memory segment that the server should map. yes, the server maps it. that's the whole point.read_onlyβTrueif the segment shall be mapped read only by the X11 server, otherwisefalse. so like, do you trust them with write access or not? π
π DESCRIPTION π
okay so the vibe here is: you're attaching a System V shared memory segment to the server. that's the whole plot.
heads up though β this will fail unless the server has permission to map the segment. no permission, no segment, no service. periodt. π
the cute part? the client may destroy the segment as soon as it receives a XCB_SHM_COMPLETION event with the shmseg value from this request and with the appropriate serial number. so you don't have to hover over it forever β once that event lands with the right serial, you're free to yeet the segment. β¨
π RETURN VALUE π
she returns an xcb_void_cookie_t. errors, if any, have to be handled in the event loop. that's the deal, no takebacks.
if you'd rather handle errors directly with xcb_request_check instead, use xcb_shm_attach_checked. see xcb-requests(3) for the details, iykyk.
π ERRORS π
this request does never generate any errors. not one. zero. the cleanest girl in the function table, no cap. π
π₯ SEE ALSO π₯
π§ AUTHOR π§
Generated from shm.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. (not me writing this at 2am, it's literally the manpage, go tell the mailing list bestie π«Ά)
and that's the tea β β brought to you by X Version 11, libxcb 1.17.0, and the xcb_shm_attach(3) page itself. go map something. slay π
β¨
π¦ 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