Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ shmbind(2) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

intro(2)

shmget(2)

shmop(2)

memory(7)

shmbind(2)  —  CX/UX

NAME

shmbind − bind physical memory to a shared memory segment

SYNOPSIS

#include <sys/types.h>
#include <sys/pmap.h>

int shmbind (shmid, s_addr)
int shmid;
caddr_t s_addr;

DESCRIPTION

shmbind binds an existing shared memory region, referenced by the shared memory identifier, shmid, to an explicit section of physical memory.  The shared memory region must have been previously created via a call to shmget(2).  The section of physical memory bound to the shared memory region is specified by its starting address, s_addr, and the size of the shared memory region that it is being bound to.  For example, if the shared memory region referenced by shmid was created (see shmget(2)) with a size of 1024 (decimal) bytes, and the s_addr argument to the shmbind call is given as 0xffff8000 (hex), the range of physical memory that will be bound is 0xffff8000 to 0xffff83ff inclusive. 

To preserve system integrity, the shmbind service is reserved for exclusive use by the super-user, although the permission mode of the bound shared memory region may be set such that any user or group of users may attach it [see shmctl(2) and shmconfig(1M)]. 

shmbind will fail, and no physical memory will be bound to the shared memory segment if one or more of the following are true:

­[EPERM] The user-id of the calling process is not that of the super-user or the user does not have the ACC_SHMBIND access vector. (If access vectors are configured)

­[EINVAL] S_addr is not page aligned, and/or the size of the region being bound is less than or equal to zero. 

­[EINVAL] Shmid is not a valid shared memory identifier. 

­[EBADSPACE] The shared memory region referenced by shmid is loaded into the local memory of a processor other than the one the calling process is executing on.  A region loaded into a given processor’s local memory can only be accessed by processes being executed on that CPU [see memory(7)]. 

­[EBADSPACE] All or some portion of the physical address range defined by s_addr and length lies outside of the I/O space defined by IOBEG (0x80000000). 

­[EBUSY] The shared memory region referenced by shmid is currently attached to one or more processes. 

­[EREGSTALE] The shared memory region referenced by shmid has valid data pages that would be destroyed by the bind operation. 

­[ENOMEM] One or more of the physical pages contained in the range defined by s_addr and length have already been allocated.  It is possible to avoid this by reserving the desired physical memory pages in the configuration file.  See the CX/UX System Administration Manual for details. 

­[ENOMEM] Binding a region of this size would exceed the system imposed limit on the number of locked (resident) pages. 

RETURN VALUES

Upon successful completion shmbind returns a value of 0. 

Otherwise, a value of −1 is returned and errno is set to indicate the error. 

SEE ALSO

intro(2), shmget(2), shmop(2). 
memory(7) in the CX/UX Administrator’s Reference Manual. 

CX/UX Programmer’s Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026