HP-UX Reference (11i v2 07/12) - 1M System Administration Commands N-Z (vol 4)

s
setmemwindow(1M) setmemwindow(1M)
memory window. A common usage of these commands is to extract a memory window id with
get-
memwindow
, 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 returned exit value is 0 on success or a positive number on failure.
If
-n is not specified, the value returned is the exit status of the executed program obtained from the wait-
pid(2) 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.
336 Hewlett-Packard Company 3 HP-UX 11i Version 2: December 2007 Update