HP-UX Reference (11i v2 03/08) - 1M System Administration Commands N-Z (vol 4)
s
setmemwindow(1M) setmemwindow(1M)
NAME
setmemwindow - changes the window id of a running program or starts a program in a particular memory
window
SYNOPSIS
setmemwindow [ -cjnfbov ][-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 non-zero pid, only the process’ 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 exec’s 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,
fork’s a child and exec’s 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 fork’ing 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 exec program regardless if the setmemwindow is unable to
change the process’ window to the specified WinId. The failure to create a specific window may be the
effect of the lack of available memory windows - the underlying kernel has not been configured with
enough memory windows (exit status ENOMEM) or the feature is not implemented (exit status ENOSYS).
Options
-i WinId Specifies the desired memory window. WinId is a key to the desired memory window.
WinId is a user specified value and should be one of the values contained in the file
/etc/services.window
. Applications extract the user key from
/etc/services.window
according to a unique string contained in
/etc/services.window
, using the getmemwindow command. (See
getmemwindow(1M) and services.window(4).)
The kernel tries to locate an existing window with WinId. If one is found, that window is
used. If no window with WinId is found, an unused entry is located and assigned to WinId.
The value
0 for WinID is special. If specified, the process/program is placed into the default
global window instead of a unique window with id WinId.
If WinID is unspecified, the process and its children will run in a private memory window,
and no other processes in the system can attach to this memory window. This memory win-
dow remains active until the process and its children terminate.
-p pid | program [arg ...]
Change the memory window for process pid, or start program in the specified memory win-
dow. If program has arguments (arg ...), they must also be specified.
If
-p is unspecified or the value of pid is 0, the calling process has its window id changed,
and program is exec’ed.
If a non-zero process pid is specified, only the window in that process is changed, and pro-
gram is ignored.
-c Create a window with id WinId and attach the specified process to it. If WinId already
exists the call fails.
HP-UX 11i Version 2: August 2003 − 1 − Hewlett-Packard Company Section 1M−−749