ra_get_attachinfo Subroutine
Purpose
Retrieves the resource set attachments to which a work component is attached.
Library
Standard C library (libc.a)
Syntax
#include <sys/rset.h>
attachinfo_t *ra_get_attachinfo(rstype, rsid, offset, length, flags)
rstype_t rstype;
rsid_t rsid;
off64_t offset;
size64_t length;
unsigned int flags;
Description
The ra_get_attachinfo subroutine retrieves information describing the attachments involving the work component specified by rstype and rsid.
This information is returned as a null-terminated linked list of attachinfo_t structures. The attachinfo_t structures are allocated in the caller's process heap. The ra_free_attachinfo subroutine is provided to free the list of attachinfo_t structures returned by ra_get_attachinfo.
- A shared memory object identified by a shared memory segment ID.
- A file identified by an open file descriptor.
- An address range in the current user process.
- An address range in one of the above work components identified by its offset in the object and its length.
If rstype is a memory object
and length has a 0
value,
the attachment information returned is for the last portion of the
memory object, beginning with offset.
Parameters
Item | Description |
---|---|
rstype | Specifies the type of work component for which
the attachment information is to be retrieved. This parameter can
have one of the following values:
|
rsid | Identifies the work component for which the
attachment information is to be retrieved. This parameter can be one
of the following:
|
offset | Specifies the offset of a range within a memory
object for which the attachment information is to be retrieved. This
parameter is taken into account only for the following values of rstype:
|
length | Specifies the length of a range within a memory
object for which the attachment information is to be retrieved. This
parameter is taken into account only for the following values of rstype:
|
flags | Reserved for future use. Specify as 0 . |
Return Values
On successful
completion, a pointer to the first element in a null-terminated list
of attachinfo_t structures is returned.
A null pointer is returned if the work component does not have any
attachments. Otherwise, a value of -1
is returned
and the errno global variable is set to
indicate the error.
Error Codes
Item | Description |
---|---|
EINVAL | One of the following conditions is true:
|
EBADF | The rstype parameter is R_FILDES and rsid is not a valid open file descriptor. |
ENOTSUP | The rstype parameter is R_PROCMEM and rsid.at_pid field is not RS_MYSELF. |