Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 2 Feb 2005 15:20:01 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com, newlib AT sources DOT redhat DOT com Subject: Re: several more bugs found by coreutils Message-ID: <20050202142001.GI31117@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com, newlib AT sources DOT redhat DOT com Mail-Followup-To: cygwin AT cygwin DOT com, newlib AT sources DOT redhat DOT com References: <020120052058 DOT 2301 DOT 41FFED5A000D5EEC000008FD22007614380A050E040D0C079D0A AT comcast DOT net> <20050202100718 DOT GA7767 AT cygbert DOT vinschen DOT de> <4200DE19 DOT 70504 AT byu DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4200DE19.70504@byu.net> User-Agent: Mutt/1.4.2i 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? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/