MEMCHMD(2) — Series 500 Only
NAME
memchmd − change memory segment access modes
SYNOPSIS
#include <sys/ems.h>
#include <sys/types.h>
intmemchmd (addr, mode);
caddr_taddr;
intmode;
HP-UX COMPATIBILITY
Level: Extended Memory - HP-UX/EXTENDED
Origin: HP
Remarks: Memchmd is not currently implemented on the Series 200.
DESCRIPTION
This procedure may be used to change the access mode of a memory segment created by memallc(2). The procedure returns the previous access mode (or -1 if there is an error).
Addr is the segment pointer returned by memallc(2).
The access modes for a shared segment is an attribute of the segment and is the same for all processes sharing the segment or any portion thereof. The access mode of a segment may not be changed if it is being shared with any other process (e.g. more than one memallc of a peculiar file, or a memallc followed by a fork(2)). An attempt to memchmd such a shared segment will return an error [EACCES].
The access mode of a MEM_PRIVATE segment may be changed without restrictions.
The definition of the access modes are:
MEM_X Execute capability
MEM_W Write capability
MEM_R Read capability
An error is returned if addr is not a valid segment pointer.
Access modes granted to a MEM_SHARED file mapped segment may not exceed the access modes granted to the user of the file when it was opened.
RETURN VALUE
Upon successful completion, memchmd(2) returns the old set of access modes. Otherwise, a value of -1 is returned and errno is set to indicate the error.
HARDWARE DEPENDENCIES
This system call is supported on Series 500 only.
SEE ALSO
ems(2), memallc(2), memvary(2).
Hewlett-Packard — last mod. May 11, 2021