several more bugs found by coreutils
Christopher Faylor
cgf-no-personal-reply-please@cygwin.com
Wed Feb 2 17:20:00 GMT 2005
On Wed, Feb 02, 2005 at 03:20:01PM +0100, Corinna Vinschen wrote:
>On Feb 2 07:05, Eric Blake wrote:
>> > On Feb 1 20:58, Erik Blake wrote:
>>
>> Eric, not Erik.
>
>Hups. I'm wondering how that could happen. I didn't change the
>address manually. Weird. Sorry 'bout that, anyway.
>
>> > include/pwd.h is a newlib file. However, I was pretty happy that pw_uid
>> > and pw_gid were defined as int, when we changed uids and gids from 16 to
>> > 32 bits. It was the one file which wasn't necessary to change.
>>
>> Is it worth introducing two definitions in cygwin, guarded by
>> __CYGWIN_USE_BIG_TYPES__, as is done elsewhere (for example sys/dirent.h)?
>> Or how about something like the following to ensure that pw_comment
>> remains at the same offset regardless of whether sizeof(uid_t) == sizeof(int):
>>
>> struct passwd {
>> char *pw_name;
>> char *pw_passwd;
>> union {
>> int __filler;
>> uid_t upw_uid;
>> } u;
>> /* etc. */
>> };
>> #define pw_uid u.upw_uid;
>
>Urgh. That's ugly, IMHO. Basically, uid_t should be used always.
>For the sake of a questionable backward compatibility, it might be
>worth to do something like this:
>
> #if defined (__CYGWIN__) && !defined (__CYGWIN_USE_BIG_TYPES__)
> #define __pw_uid_t int
> #endif
> #ifndef __pw_uid_t
> #define __pw_uid_t uid_t;
> #endif
>
> struct passwd {
> char *pw_name;
> char *pw_passwd;
> __pw_uid_t pw_uid;
> __pw_gid_t pw_gid;
> [etc].
>
>Would that be ok, Jeff?
Why not just make __pw_uid_t a typedef?
cgf
More information about the Newlib
mailing list