setmemwindow.1m (2010 09)

s
setmemwindow(1M) setmemwindow(1M)
The /etc/services.window
file maps a memory window application to a particular window ID.
Using this central file allows applications to share memory windows, by using the same window ID, as
well as avoid unintentional memory window collisions. See services.window(4) for more information.
The
getmemwindow command is used to extract the window ID of a user process from the
/etc/services.window
file. The setmemwindow command starts a particular process in a memory
window. A common usage of these commands is to extract a memory window ID with
getmemwindow,
which is then passed to
setmemwindow to start a process with the given window ID.
Processes must be in the same window to share data. Processes wanting to share global data, such as
shared memory or
MAP_SHARED memory mapped files, must make sure all processes are in the same
memory window. If processes in different memory windows wish to share data reliably, the creator of the
data must take steps to guarantee the data is placed in a location accessible to all processes.
For more detailed information on memory windows, refer to the Memory Windows in HP-UX 11.0 White
Paper.
RETURN VALUE
The exit value is 0 on success or a positive number on failure.
If
-n is not specified, the value is the exit status of the executed program , obtained from the
waitpid()
system call.
EXAMPLES
Start the program
myprog in a memory window extracted by the string myapp.
WinId=$(getmemwindow myapp)
setmemwindow -i $WinId myprog arg1 arg2
Start the program myprog in a newly created memory window extracted by the string myapp.
WinId=$(getmemwindow myapp)
setmemwindow -c -i $WinId myprog arg1 arg2
Start the program myprog in an existing memory window extracted by the string myapp.
WinId=$(getmemwindow myapp)
setmemwindow -j -i $WinId myprog arg1 arg2
Start the program myprog in a private memory window. Only myprog and its descendents can access
the window.
setmemwindow myprog arg1 arg2
WARNINGS
Programs using a memory window can access shared memory objects created by other programs using the
same window (depending upon permissions). However, by default, programs using a memory window
may not be able to access shared memory objects created by programs using other windows or those not
using windows at all.
To enable access to a shared memory object across programs using different windows, or between those
using windows and those not using windows, the program must specify special options when creating the
object. See shmget(2) and mmap(2) for details.
AUTHOR
setmemwindow was developed by HP.
FILES
/etc/services.window File containing applications’ associated window IDs.
SEE ALSO
getmemwindow(1M), services.window(4).
Memory Windows in HP-UX 11.0 White Paper.
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3