Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ttrace_wait(2) [hpux man page]

ttrace_wait(2)							System Calls Manual						    ttrace_wait(2)

NAME
ttrace_wait - wait for ttrace event SYNOPSIS
DESCRIPTION
The system call provides a means to wait for a event to occur. A tracing process (debugger) will normally invoke after a process or any of its threads has been set running. synchronizes tracing requests directed at threads within the traced process. This mechanism differs from the process-oriented synchroniza- tion provided by or (see wait(2)). The pid argument identifies the process-id of a traced process which the debugger expects to stop. If pid is a positive value, and lwpid is zero, then will wait for any thread in the traced process identified by pid to stop in response to an outstanding ttrace event. The information concerning the thread that hit the event point is available in the ttstate_t structure (see ttrace(2)). The lwpid argument identifies the Lightweight Process (LWP) id of a thread in the traced process pid for which the debugger must wait to validate request completion. If both pid and lwpid are non-zero values, suspends the calling process until the specified LWP in the traced process stops. When multiple child processes are simultaneously traced, can be used to identify the process-id and LWP id of a thread which stopped in response to any outstanding request established for the group of traced child processes. This is achieved by invoking with both pid and lwpid set to 0 (zero). A zero pid and non-zero lwpid will return an error. The option argument must specify either or These values control the synchronizing effect of on the calling process. The value causes to behave in non-blocking mode and return to the calling process immediately whether or not a pre-existing ttrace request completed on behalf of the tracing process. With suspends the calling process until the requested pid and/or LWP stop. As mentioned above, the tsp argument references a ttstate_t structure (see ttrace(2)) which provides all the needed information regarding the stopped thread. The size argument specifies the size of the ttstate_t structure referenced by addr. RETURN VALUE
If the call succeeds, will return 1 (one) if the event was never waited for, 0 (zero) otherwise. If the call fails, -1 is returned and is set to the appropriate value. ERRORS
The system call fails if one or more of the following is true: [EINVAL] pid is zero and lwpid is non-zero. [EINVAL] The option is invalid. [EINVAL] The lwpid is not controlled by process pid. [ESRCH] The pid or lwpid do not identify an existing process (LWP). [EACCES] The pid does not identify a process debugged by the invoking process. [ECHILD] The process (LWP) died while it was waited for. [EINTR] was interrupted by a signal. [EFAULT] An invalid address was given for the kernel to write data into. AUTHOR
was developed by HP. SEE ALSO
ttrace(2), wait(2). ttrace_wait(2)

Check Out this Related Man Page

setpgid(3)						     Library Functions Manual							setpgid(3)

Name
       setpgid - set process group (POSIX)

Syntax
       #include <sys/types.h>
       int
       setpgid(pid, pgrp)
       pid_t pid, pgrp;

Description
       The  function is used to either join an existing process group or create a new process group within the session of the calling process (see
       Upon successful completion, the process group ID of the process that has a process ID which matches pid is set to pgrp.	If  pid  is  zero,
       then the call applies to the current process. In addition, if pgrp is zero, the process ID of the indicated process is used.

       This function is available only in the POSIX environment.

Return Values
       The  function  returns 0 when the operation is successful.  If the request fails, -1 is returned and the global variable indicates the rea-
       son.

Diagnostics
       The function fails and the process group is not altered if one of the following occurs:

       [EACCES]       The value of the pid argument matches the process ID of a child process of the calling process and  the  child  process  has
		      successfully executed an function.

       [EINVAL]       The value of the pgrp argument is less than zero or is not a supported value.

       [EPERM]	      The process indicated by the pid argument is a session leader.

		      The  value of the pid argument matches the process ID of a child process of the calling process and the child process is not
		      in the same session as the calling process.

		      The value of the pgrp argument does not match the process ID of the process indicated by the pid argument and  there  is	no
		      process with a process group ID that matches the value of the pgrp argument in the same session as the calling process.

       [ESRCH]	      The  value  of  the  pid	argument  does	not  match the process ID of the calling process of a child process of the calling
		      process.

See Also
       getpgrp(2), setsid(2)

																	setpgid(3)
Man Page