www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/03/16/19:57:24

Date: Fri, 16 Mar 2001 19:57:11 -0500
Message-Id: <200103170057.TAA09098@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT envy DOT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp-workers AT delorie DOT com
In-reply-to: <3AB26D06.10811.1650EF@localhost> (snowball3@bigfoot.com)
Subject: Re: zero fill the eof gap 2
References: <3AB26D06 DOT 10811 DOT 1650EF AT localhost>
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

> Index: src/libc/compat/unistd/llseek.c
> + 
> + /* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */

Why the blank line?

> Index: src/libc/dos/io/_write.c
> +   
> +   /* Fill the transfer buffer with zeros.  */
>     tbsize = _go32_info_block.size_of_transfer_buffer;
> !   fill_count = cur_off - eof_off;
> ! 
> !   buf_size = (fill_count > tbsize) ? tbsize : fill_count;
> ! 
> !   i = 0;
> !   _farsetsel(_dos_ds);
> !   while (i < buf_size)
> !   {
> !     _farnspokel(__tb + i, 0);
> !     i += 4;
> !   }
> ! 
> !   return write_int(fd, NULL, fill_count);
> ! }

What if the gap is bigger than the transfer buffer size?

> ! static int
> ! write_int(int fd, const char *buffer, size_t write_count)

Why can't write() use this also?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019