From: sandmann AT clio DOT rice DOT edu (Charles Sandmann) Message-Id: <10111111931.AA17953@clio.rice.edu> Subject: Re: RESEND: Patch to computer st_blksize in struct stat To: djgpp-workers AT delorie DOT com Date: Sun, 11 Nov 2001 13:31:30 -0600 (CST) Cc: rich AT phekda DOT freeserve DOT co DOT uk In-Reply-To: <3BEE6BCC.C6164CD0@phekda.freeserve.co.uk> from "Richard Dawe" at Nov 11, 2001 12:15:08 PM X-Mailer: ELM [version 2.5 PL2] Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Below is a patch to compute st_blksize in struct stat. This is basically > the st_blocks patch with the st_blocks stuff removed. Since we fill out st_rdev, should the comment /* unused */ be removed? I know it's not related to this patch, but it removes incorrect information in the header: > *** include/sys/stat.h 2000/12/05 14:05:53 1.4 ... > off_t st_size; > ! blksize_t st_blksize; > uid_t st_uid; > dev_t st_rdev; /* unused */ > }; In stat.txh and lstat.txh this field should also be documented. > Index: src/libc/posix/sys/stat/xstat.c ... > + > + _fixpath(path, fixed_path); > + d = tolower(path[0]) - 'a'; Calling fixpath just to get the drive letter seems like overkill here. If the in path has a ':' in the second char we could use it; else get the current drive. If you do call fixpath there is no need to tolower the character since it will always be lower case. But for drives > 26 this algorithm also returns the wrong drive number (must subtract 'A' - a minor issue since I've never worked on a system that supported these).