[OpenAFS] Build problem on SuSE 9.2 with openafs-1.4.0-rc1

Jeremy Bowen jeremyb@iserve.net.nz
Mon, 5 Sep 2005 13:13:49 +1200


On Mon, 05 Sep 2005 11:32 am, Jeremy Bowen wrote:
> It appears that configure hasn't determined that the task_struct used on my
> system has rlim as an element.
> I have struct task_struct defined in /usr/src/linux/include/linux/sched.h
> and it includes a struct rlimit rlim[RLIM_NLIMITS]; member
>
> configure looks for this on line 4010 but doesn't appear to find it.

Below is a patch to configure that makes things work on my system. (Maybe gcc 
v3.3.4 is a bit more picky about referencing structure elements in a printf 
and causes the conftest test to fail...???) 

I suspect this is OK for newer kernels/gcc but may not be safe for older 
task_struct's which don't have rlim as a structure. YMMV. Consequently I'm 
posting this for information only.

Jeremy 
===========================================================
*** configure.orig      2005-08-22 15:33:54.000000000 +1200
--- configure   2005-09-05 11:41:40.718250190 +1200
***************
*** 4019,4025 ****
  #include <linux/sched.h>
  int main() {
  struct task_struct _tsk;
! printf("%d\n", _tsk.rlim);
  ; return 0; }
  EOF
  if { (eval echo configure:4026: \"$ac_compile\") 1>&5; (eval $ac_compile) 
2>&5; }; then
--- 4019,4025 ----
  #include <linux/sched.h>
  int main() {
  struct task_struct _tsk;
! printf("%d\n", _tsk.rlim[0]);
  ; return 0; }
  EOF
  if { (eval echo configure:4026: \"$ac_compile\") 1>&5; (eval $ac_compile) 
2>&5; }; then