scrmem_open()

Obtain a handle to Screen buffer memory

Synopsis:

#include <scrmem/scrmem_open.h>
errno_t scrmem_open(struct scrmem **scrmem_out, int bufid, int accmode, const struct _client_info *client)

Arguments:

scrmem_out
A pointer to a location where this function, if successful, writes a pointer that represents the reference being held.
bufid
The identifier of the buffer to open. In struct win_image (also known as win_image_t), if WIN_IMAGE_FLAG_SCRMEM is set, the fd field contains the identifier.
accmode
The access mode to use. Pass O_RDONLY, O_RDWR, or O_WRONLY (from fcntl.h).
client
A pointer to information about the client requesting access. This is used to validate that the client has the required permissions. If NULL, no extra checks are done. The structure isn't accessed after this function returns, and future permission changes don't affect existing references.

Library:

libscrmem

Description:

The scrmem_open() function obtains a handle to Screen buffer memory. Use scrmem_close() when finished with it. Screen doesn't free the memory before scrmem_close() is used.

This function can only be called by code running within the Screen process.

Returns:

EOK
A handle was stored at *scrmem_out.
EACCES
The specified client was not allowed to access the object.
EINVAL
An invalid parameter value was specified.
ENOENT
The bufid isn't valid.
EPERM
The client is NULL and accmode specified a disallowed access mode.
Page updated: