On 28 November 2012 12:35, Vineet Gupta <[email protected]> wrote: > On Wednesday 28 November 2012 04:47 PM, Markos Chandras wrote: >> On 28 November 2012 10:58, Vineet Gupta <[email protected]> wrote: >>> Precisely - now we are all on same page. So collecting all the ideas so >>> far for conclusion: >>> >>> (3) Have stat/stat64 with same overall layout but stat will internally >>> have 32 bit items (with appropriate padding) - allowing both structs to >>> be used in the 64bit syscall interface. This needs no interworking crap >>> except for some overflow checks (by testing high word). >> >> I am currently doing that. 32-bit members and 32-bit padding for the >> new struct statfs/stat. I am thinking we may have problems with >> endianness? For example in little endian arches the padding should >> come first whereas for big endian the pudding should come >> second or something like that. We can go away with using 64-bit member >> but this might break in some cases where the userland application does >> not use typeof() to get the type of the struct member, but assumes >> it's 32-bit or something. >> >>> >>> So in theory both #2 and #3 are acceptable solutions. I'd vote for #3. >>> >>> Comments ! >>> >>> That should work. I will send a new >>>> patch when I have something working. >>>> >>>> >>> >>> To make this plug-n-play for uClibc ports for future no-legacy-syscalls >>> kernels, you probably would need to define a >>> libc/sysdeps/linux/common-no-legacy/bits/{stat.h,xxx} and have that be >>> selected based on !ARCH_HAS_DEPRECATED_SYSCALLS. >> >> That seems fair yes. It's better to have a common place for these >> arches instead of having each one of them >> carrying their own structures (which will be pretty much identical) > > It seems that ARCH_HAS_DEPRECATED_SYSCALLS can be made to better use here. > > The current implementation of newer code uses > #if defined(__NR_{fstat64,fstatat64}) && !defined(legacy_xxx) > > Instead if we could make this just #ifndef ARCH_HAS_DEPRECATED_SYSCALLS > then uClibc is guaranteed to provide the standard ABI based solely on > __NR_{fstat64,fstatat64} - even if the kernel provides the legacy > syscalls or not. > > With this I can see stronger coupling of no-legacy-syscall-kernels with > this uClibc config option. > > -Vineet
Hmm I am not sure I understand that. Did you mean s/fstatat64/statfs/ ? I am not sure if using ARCH_HAS_DEPRECATED_SYSCALLS is the correct way here. It is possible (although unlikely) for an existing arch to drop some old system calls from the kernel at some point but it may not update the uClibc config at the same time. So for that arch, the syscalls that depend on ARCH_HAS_DEPRECATED_SYSCALLS will be broken until the arch is updated to define ARCH_HAS_DEPRECATED_SYSCALLS. I see no problem with the existing #if defined(__NR_newsyscall) && !defined(__NR_oldsyscall) approach. It is consistent with what uClibc already does in some other places too. -- Regards, Markos _______________________________________________ uClibc mailing list [email protected] http://lists.busybox.net/mailman/listinfo/uclibc
