xcb\_shm\_attach(3) XCB Requests xcb\_shm\_attach(3)

# [NAME](#NAME)

xcb\_shm\_attach - Attach a System V shared memory segment.

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;xcb/shm.h&gt;**

## [Request function](#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*);

# [REQUEST ARGUMENTS](#REQUEST_ARGUMENTS)

[*conn*](#conn)

The XCB connection to X11.

[*shmseg*](#shmseg)

A shared memory segment ID created with xcb\_generate\_id().

[*shmid*](#shmid)

The System V shared memory segment the server should map.

[*read\_only*](#read_only)

True if the segment shall be mapped read only by the X11 server, otherwise false.

# [DESCRIPTION](#DESCRIPTION)

Attach a System V shared memory segment to the server. This will fail unless the server has permission to map the segment. The client may destroy the segment as soon as it receives a XCB\_SHM\_COMPLETION event with the shmseg value in this request and with the appropriate serial number.

# [RETURN VALUE](#RETURN_VALUE)

Returns an *xcb\_void\_cookie\_t*. Errors (if any) have to be handled in the event loop.

If you want to handle errors directly with *xcb\_request\_check* instead, use *xcb\_shm\_attach\_checked*. See [**xcb-requests(3)**](/man/os/libxcb/xcb-requests.3) for details.

# [ERRORS](#ERRORS)

This request does never generate any errors.

# [SEE ALSO](#SEE_ALSO)

[**xcb-requests**(3)](/man/os/libxcb/xcb-requests.3)

# [AUTHOR](#AUTHOR)

Generated from shm.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.

libxcb 1.17.0 X Version 11

---

Document: xcb_shm_attach(3) from libxcb 1.17.0-r18 (Chainguard OS)
Source: https://gitlab.freedesktop.org/xorg/lib/libxcb.git
