lkml.org 
[lkml]   [1999]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sed not working on /proc files
On Mon, Apr 26, 1999 at 07:29:04PM -0400, Richard B. Johnson wrote:

> The sed on my system, which is quite old, not from a standards
> distribution, does, indeed do lseek to find the file-size. Your
> version does 'fstat' which will accomplish the same thing. Typically
> a program that does 'lseek(0, SEEK_CUR)` expects to have the correct
> return value or errno be set to ESPIPE which lets it know that it's
> a pipe, socket, or fifo. This lets it work with such.

Optimizing this useless lseek(2) away was one of the libc changes during
the last ages.

Ralf

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.090 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site