From kde-core-devel Wed Jun 21 09:19:03 2006 From: Michael Buesch Date: Wed, 21 Jun 2006 09:19:03 +0000 To: kde-core-devel Subject: Re: 0 or 0L for empty pointers? Message-Id: <200606211119.04066.mb () bu3sch ! de> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=115105113508374 On Wednesday 21 June 2006 11:07, Brad Hards wrote: > On Wednesday 21 June 2006 07:15 am, Michael Buesch wrote: > > sizeof(long)==sizeof(void*) is an assumption in the linux kernel, at least. > > So it is true for all archs which are supported by linux. > I'm not sure you can safely assume that userspace and kernel space are the > same. I vaguely remember that sparc or mips has 64 bit kernelspace and 32 bit > userspace. Sure. But the assumption is still valid. The assumption in linux is exactly as follows: sizeof(kernel long) == sizeof(kernel void *) sizeof(user long) == sizeof(user void *) sizeof(kernel long) maybe!= sizeof(user void *) PPC64 generally has a 64bit kernel and 32bit userspace, because 32bit ppc code is faster. I think sparc is similiar, but I don't know of the reasons. Mips, well. I never saw a mips64 machine. Do they exist? -- Greetings Michael.