summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tapset/context.stp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tapset/context.stp b/tapset/context.stp
index 5d855f80..468421ae 100644
--- a/tapset/context.stp
+++ b/tapset/context.stp
@@ -70,9 +70,13 @@ function ppid:long () %{ /* pure */
* leader. Session ID is stored in the signal_struct since Kernel 2.6.0.
*/
function sid:long () %{ /* pure */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
struct signal_struct *ss = kread( &(current->signal) );
THIS->__retvalue = kread ( &(ss->session) );
CATCH_DEREF_FAULT();
+#else
+ THIS->__retvalue = task_session_nr_ns(current, &init_pid_ns);
+#endif
%}
/**