git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Replacing the system call pread() with lseek()/xread()/lseek() sequence.

From
Nicolas Pitre <nico@cam.org>
Date
Jan 10, 2007, 00:59 UTC
Message-ID
<Pine.LNX.4.64.0701091958170.4964@xanadu.home>
In-Reply-To
<Pine.LNX.4.63.0701100041310.22628@wbgn013.biozentrum.uni-wuerzburg.de>
On Wed, 10 Jan 2007, Johannes Schindelin wrote:
Show 18 quoted lines
> Hi,
> 
> On Tue, 9 Jan 2007, Andy Whitcroft wrote:
> 
> > Stefan-W. Hahn wrote:
> >
> > > +        if (current_offset != lseek(fd, current_offset, SEEK_SET))
> > > +                return -1;
> > 
> > How likely are we ever to be in the right place here?
> 
> You mean something like
> 
> 	if (current_offset != offset + count &&
> 			current_offset != lseek(fd, current_offset, SEEK_SET))
> 		return -1;
> 
> instead? Seems cheap enough.
In the index-pack case it simply will never happen.
Nicolas
Previous: Johannes Schindelin
Message 8 of 8 in “Replacing the system call pread() with lseek()/xread()/lseek() sequence.”
  1. Replacing the system call pread() with lseek()/xread()/lseek() sequence.Stefan-W. Hahn, Jan 9, 2007
  2. Andy WhitcroftJan 9, 2007
  3. Shawn O. PearceJan 9, 2007
  4. Junio C HamanoJan 10, 2007
  5. Johannes SchindelinJan 10, 2007
  6. Nicolas PitreJan 10, 2007
  7. Johannes SchindelinJan 9, 2007
  8. Nicolas PitreJan 10, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.