This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] Fix compilation failure of remote-fileio.c
- From: "Eli Zaretskii" <eliz at elta dot co dot il>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 29 Dec 2003 08:58:43 +0200
- Subject: Re: [RFC] Fix compilation failure of remote-fileio.c
- References: <ubrpt6odu.fsf@elta.co.il> <20031228233800.GA815@nevyn.them.org>
- Reply-to: Eli Zaretskii <eliz at elta dot co dot il>
> Date: Sun, 28 Dec 2003 18:38:00 -0500
> From: Daniel Jacobowitz <drow@mvista.com>
>
> The value st_blocks gives the size of the file in 512-byte
> blocks. (This may be smaller than st_size/512 e.g. when the
> file has holes.) The value st_blksize gives the "preferred"
> blocksize for efficient file system I/O. (Writing to a file in
> smaller chunks may cause an inefficient read-modify-rewrite.)
Ah, right, I forgot about that.
(Is this optimal size for I/O still relevant for modern systems?)
> So you probably want st->st_size / 512 instead.
So, if I keep the conditional and use the divide-by-512 way for
systems that don't have st_blocks, is the patch approved? Or do I
need to wait for someone else?
(Thanks for the other suggestions, I will use them.)