Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (s and S) shmat(2)
Refer to the SEGMENT_ALLOCATE_ procedure description in the Guardian Procedure Calls
Reference Manual for more information about segment limits.
RETURN VALUES
Upon successful completion, the shmat() function increments the value of the shm_nattch field
in the structure associated with the shared memory identifier of the attached shared memory seg-
ment. The starting address for the attached segment is returned.
Otherwise, the value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the shmat() function sets errno to the corresponding
value and does not attach the shared memory segment:
[EACCES] The calling process does not have access permission for the requested operation.
[EINVAL] One of the following is true:
The shmid parameter does not specify a valid shared memory identifier.
All of these conditions are true:
The shmaddr parameter is not a null pointer
Rounding is not specified: (shmflag & SHM_RND) is 0 (zero).
There is inadequate virtual address available in the process to
allocate the requested segment at the specified or rounded or
default address.
[EMFILE] On servers running J06.11 or earlier J-series RVUs, H06.22 or earlier H-series
RVUs, or G-series RVUs, an attempt to attach a shared memory segment
exceeded the maximum number of attached segments allowed for any one pro-
cess.
[ENOMEM] There was not enough data space available to attach the shared memory segment
and allocate the associated low-level data structures.
[ENOTOSS] The calling process is not an OSS process. The requested operation cannot be
performed from the Guardian environment on servers running J06.11 or earlier
J-series RVUs, H06.22 or earlier H-series RVUs, or G-series RVUs.
RELATED INFORMATION
Commands: ipcrm(1), ipcs(1).
Functions: exec(2), _exit(2), fork(2), shmctl(2), shmdt(2), shmget(2), tdm_execve(2),
tdm_execvep(2), tdm_fork(2), tdm_spawn(2), tdm_spawnp(2).
STANDARDS CONFORMANCE
The SHMLBA constant is used for a nontraditional value.
The following are HP extensions to the XPG4 Version 2 specification:
On servers running J06.11 or earlier J-series RVUs, H06.22 or earlier H-series RVUs, or
G-series RVUs, the errno value [ENOTOSS] can be returned if this function is called
from a Guardian process.
527186-023 Hewlett-Packard Company 779