LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE
+ LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO
LINUX_GET_SB_HAS_STRUCT_VFSMOUNT
LINUX_STATFS_TAKES_DENTRY
if test "x$ac_cv_linux_sched_struct_task_struct_has_exit_state" = "xyes"; then
AC_DEFINE(STRUCT_TASK_STRUCT_HAS_EXIT_STATE, 1, [define if your struct task_struct has exit_state])
fi
+ if test "x$ac_cv_linux_sched_struct_task_struct_has_tgid" = "xyes"; then
+ AC_DEFINE(STRUCT_TASK_STRUCT_HAS_TGID, 1, [define if your struct task_struct has tgid])
+ fi
if test "x$ac_cv_linux_sched_struct_task_struct_has_todo" = "xyes"; then
AC_DEFINE(STRUCT_TASK_STRUCT_HAS_TODO, 1, [define if your struct task_struct has todo])
fi
#undef getuerror
+#ifdef STRUCT_TASK_STRUCT_HAS_TGID
+#define getpid() current->tgid
+#ifdef STRUCT_TASK_STRUCT_HAS_REAL_PARENT
+#define getppid() current->real_parent->tgid
+#elif defined(STRUCT_TASK_STRUCT_HAS_PARENT)
+#define getppid() current->parent->tgid
+#else
+#define getppid() current->p_opptr->tgid
+#endif
+#else /* !STRUCT_TASK_STRUCT_HAS_TGID */
#define getpid() current->pid
#ifdef STRUCT_TASK_STRUCT_HAS_REAL_PARENT
#define getppid() current->real_parent->pid
#else
#define getppid() current->p_opptr->pid
#endif
+#endif /* STRUCT_TASK_STRUCT_HAS_TGID */
#ifdef RECALC_SIGPENDING_TAKES_VOID
#define RECALC_SIGPENDING(X) recalc_sigpending()
/* should use curthread, but 'ps' can't display it */
#define osi_ThreadUnique() curproc
#else
+#ifdef AFS_LINUX_ENV
+#define osi_ThreadUnique() (current->pid)
+#else
#define osi_ThreadUnique() getpid()
#endif
+#endif
AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
+AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID], [
+ AC_MSG_CHECKING([for tgid in struct task_struct])
+ AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_tgid], [
+ AC_TRY_KBUILD(
+[#include <linux/sched.h>],
+[struct task_struct _tsk;
+printk("%d\n", _tsk.tgid);],
+ ac_cv_linux_sched_struct_task_struct_has_tgid=yes,
+ ac_cv_linux_sched_struct_task_struct_has_tgid=no)])
+ AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_tgid)])
+
+
AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
AC_MSG_CHECKING([for real_parent in struct task_struct])
AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [