diff options
author | Przemyslaw Pawelczyk <przemyslaw@pawelczyk.it> | 2009-06-13 16:58:30 +0200 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-06-15 12:50:29 -0700 |
commit | 74f2951cc3b5d4f3716e23d284a2b3a0767eb5c2 (patch) | |
tree | adda1b9bef83534b81867075de1329b463963945 /tapset/context.stp | |
parent | 5111fc3e27f24347f61db6465da934a19b553ee6 (diff) | |
download | systemtap-steved-74f2951cc3b5d4f3716e23d284a2b3a0767eb5c2.tar.gz systemtap-steved-74f2951cc3b5d4f3716e23d284a2b3a0767eb5c2.tar.xz systemtap-steved-74f2951cc3b5d4f3716e23d284a2b3a0767eb5c2.zip |
Add pgrp() context tapset function. Describe sid().
* tapset/context.stp: Add pgrp() function.
* testsuite/buildok/context_test.stp: Add pgrp() call.
* stapfuncs.3stap.in: Describe pgrp() and sid().
Signed-off-by: Josh Stone <jistone@redhat.com>
Diffstat (limited to 'tapset/context.stp')
-rw-r--r-- | tapset/context.stp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tapset/context.stp b/tapset/context.stp index 468421ae..5be9f21f 100644 --- a/tapset/context.stp +++ b/tapset/context.stp @@ -64,6 +64,19 @@ function ppid:long () %{ /* pure */ %} /** + * sfunction pgrp - Returns the process group ID of the current process. + */ +function pgrp:long () %{ /* pure */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) + struct signal_struct *ss = kread( &(current->signal) ); + THIS->__retvalue = kread ( &(ss->pgrp) ); + CATCH_DEREF_FAULT(); +#else + THIS->__retvalue = task_pgrp_nr_ns(current, &init_pid_ns); +#endif +%} + +/** * sfunction sid - Returns the session ID of the current process. * * The session ID of a process is the process group ID of the session |