User's Guide

24 Chapter2
Using the WebQoS API
wq_set_proc_cls()
Multithreaded Applications
For HP-UX 10.20 (supports user-level threads only), all user-level
threads within one process are in the same process group.
wq_set_proc_cls() ignores scope and moves the entire process to the
specified process group.
For HP-UX 11.0 (supports 1x1 kernel threads), a thread in user space
corresponds to a kernel thread (also known as a Light Weight Process,
LWP). LWPs may belong to different process groups. Currently, WebQoS
cannot move a thread from one process group to another. Therefore, all
threads in a process are in the same process group. Set scope to
WQ_SCOPE_PROCESS to move all threads in a process to the specified
process group.
This function is NOT thread safe. Although it can be called from a
multithreaded process, the application must ensure that the function is
not called by more than one thread at a time.
Example
See Appendix A , “Sample Programs, Configuration, and Header Files,
on page 33 for an example.
WQERR_NOTROOT The process attempted to set the process group to
a value that can only be accessed by root.
WQERR_NOTREADY PRM is not installed or not configured on the
system.
WQERR_OTHER If error logging to syslog is enabled (“error” level
for all facilities), the error is logged to a file.
WQERR_PERMISSION The process does not have permission to change
to the specified process group. Make sure that the
/etc/opt/webqos/svccls.allow file is
configured and is not corrupt.
Table 2-8 wq_set_proc_cls() Error Codes
Error Code Description