[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#231972: lkh: /usr/include/linux/ptrace.h buggy



Here is more info on the problem.

The issue is that 'struct user' in <sys/user.h> on s390 need 'struct
user_regs_struct' from <asm/ptrace.h>, and this need type
's390_fp_regs' which need type 'freq_t' which need type '__u64' which
is unavailable when compiling with -ansi.  The reason the '__u64' type
is mising is that ANSI C do not define 'long long'. (Hm, is this fixed
in later versjons of ANSI C?).  So the result is that <sys/user.h> is
impossible to include in a program compiled with '-ansi' on
linux/s390.

The reason this work on other archs seem to be that 'struct user' do
not depend on a 64-bit integer type on these archs.

I assume that all glibc headers should be compilable when using 'gcc
-ansi'.

It seem hard to avoid the dependency on the 64-bit value for
<sys/user.h> on s390.  Could it be an idea to make sure there is a
64-bit type available using a packed struct?

  #if !defined(__s390x__) && !(defined(__GNUC__) && !defined(__STRICT_ANSI__))
  typedef struct {
	long first_part;
	long last_part;
  } __u64;
  #endif

This will of course break on all code _using_ variables with this
type, but might hide the problem in programs which only need a
includable <sys/user.h> to access the members available on all archs.



Reply to: