[PATCH v3 00/48] Support for cut-down Linux syscalls
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Wed Feb 6 18:11:16 UTC 2013
On 6 February 2013 17:20, Markos Chandras <markos.chandras at gmail.com> wrote:
>>>>>> Looks pretty good, thanks. One thing though:
>>>>>>
>>>>>> I really don't like common-no-legacy.
>>>>>> Can you propose a different way instread?
>>>>> How about:
>>>>>
>>>>> - common-new
>>>>> - new-interfaces
>>>>
>>>> generic
>>>> generic-syscalls
>>>>
>>>> generic wouldn't be entirely self-explanatory but would be short. ;-)
>>>
>>> I'd prefer generic-syscalls. 'generic' seems similar to 'common' so it
>>> might be a bit confusing. Bernhard, are you ok with
>>> "generic-syscalls"?
>>
>> I was thinking more in the direction of not adding that directory in
>> the first place.
>> If you look at
>> for i in $(find libc/sysdeps/linux/common-no-legacy/ -type f);do
>> i=$(basename $i);diff -duNp
>> libc/sysdeps/linux/common{,-no-legacy}/bits/$i;done | less
>> then perhaps we can use the dirent stuff everywhere, the stat.h parts
>> look dangerous (hope that nobody does interpret those long long as DI
>> mode).
>> Perhaps it is less ugly to just ifdef those few new hunks?
>>
>> Short of that (sorry did not look closely yet, perhaps you do that
>> already anyway), i'd go for common-newsyscalls and put that include
>> before the common for the arches that were switched already.
>>
>> Other ideas?
>> Comments?
>
> Well personally I believe that mixing old and new structures with
> #if/defs is a bit messy and it will be hard to spot what fields belong
> to the struct for a particular architecture. I think that keeping new
well you're right.
> architectures separate from the existing ones, is a)more safe (as in,
> you don't risk breaking existing code accidentally ), b) easier to add
> or modify new interfaces (as more new architectures are added to
> uClibc, it may be necessary to add new shared headers in the new
> common-newsyscalls directory) in the future and c) easier to deprecate
> the common/ directory if existing architectures ever migrate to
> generic syscalls.
Perhaps Will's suggestion of "generic-syscalls" is fine since the
kernel calls them generic, too.
common-generic overdoes it a bit, i guess, but it does produce a nice
tab-completion conflict with common.
So please rename it to common-generic and also add a hunk to
libc/sysdeps/linux/README to briefly explain what common-generic is.
Reading through the series..
I'd prefer if you could not put braces around the parameter of defined, e.g.:
+#if defined(__NR_fstat64) && !defined(__NR_fstat)
+#if defined __NR_fstat64 && !defined __NR_fstat
everywhere in those patches.
In ftruncate.c, we nowadays have a couple of OFF helpers in
include/endian.h (IIRC), perhaps you can use those?
/Check if valids fd and valid pointers/s/valids fd/valid fds/
on x86_64 with no threads:
libc/sysdeps/linux/common/fork.c:12:0: error: unterminated #if
sounds like a leftover from a merge-conflict. There is no need for
that __libc_fork for !threads
missing indenting space before define in
+#elif defined(__NR_fork)
+#define __NR___libc_fork __NR_fork
In statfs.c there is also a missing indenting space in the nested #if,
please add those, everywhere.
Also indent the existing ones if you add a surrounding preprocessor
conditional, please.
In the same file you duplicate the extern __typeof, please use just
one before the conditionals.
The __NR_ustat stub is only necessary if defined UCLIBC_SV4_DEPRECATED
utime.c only needs fcntl.h and stddef.h for the at path, please move it there.
utimes.c Likewise. Why do you need utime.h in there at all?
More information about the uClibc
mailing list