setmemwindow.1m (2010 09)
s
setmemwindow(1M) setmemwindow(1M)
NAME
setmemwindow - change window ID of running program or start program in particular memory window
SYNOPSIS
setmemwindow
[-bcfjnov][-i
WinId]{-p pid | program [arg]... }
DESCRIPTION
setmemwindow is the command that changes the window ID of a running process or starts a specified
program in a particular memory window.
If the
-p option is specified with a nonzero pid, only the process’s window ID is changed, and any value
specified for program is ignored.
The executable program is only executed if the process ID pid is either
0 or unspecified.
Changing the window ID for the running process does not mean the process immediately attaches to or
creates objects using that window. The targeted process does not begin using the window until it executes
a new image.
setmemwindow, used as a wrapper for an existing executable, starts the program in the desired (see
-i
option below) memory window. In order to execute program , setmemwindow changes the window ID,
forks a child and executes program in the child process. The default behavior of setmemwindow is to
wait until program finishes. If -n is specified, the waiting for program is bypassed and
setmemwindow
exits immediately after forking the child.
If
-c and -j are unspecified, the default behavior is to place the process into the window specified by
WinId.IfWinId exists, then the process is placed into that memory window. If no window exists with
WinId, an unused window is allocated and associated with WinId. -c specifies the creation of a window.
If the window already exists and -c is specified, the call fails. -j
specifies the joining to an existing win-
dow. If the window does not exist and
-j is specified, the call fails.
The
-f option instructs the command to execute program even if setmemwindow is unable to change
the process’s window to the specified WinId. The failure to create a specific window may be the effect of
the lack of available memory windows; that is, the underlying kernel:
• Has not been configured with enough memory windows (exit status [ENOMEM]);
• Was unable to allocate memory for a new window to meet this request (exit status [ENOMEM]); or
• Does not implement the feature (exit status [ENOSYS]).
Options
-b Create a memory window where both memory window quadrants use the same space ID.
For SHMEM_MAGIC executables this generates two quadrants with the same space ID.
Applications can use this to generate the appearance of larger contiguous shared memory
ranges with a maximum of 2 gigabytes. For example, an application that generates a 1
gigabyte shared memory segment has that segment placed into the 2nd quadrant by
default. If the application creates another 1 gigabyte segment that segment is placed in
the 3rd quadrant. Both segments are contiguous virtually, allowing the application to
treat the virtual range as if it were a contiguous 2 gigabyte segment.
This option only benefits
SHMEM_MAGIC executables. They are the only type of execut-
able format able to place shared objects in the 2nd quadrant.
-c Create a window with ID WinId and attach the specified process to it. If WinId already
exists the call fails.
-f The default behavior for setmemwindow is to exit without executing the user specified
program if the memory window cannot be set. The failure to set the memory window
may be caused by:
• The lack of enough memory windows in the system.
• The memory windows feature is not implemented.
• The request requires a new memory window be initialized and the system was not
able to allocate the memory to do so.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1