Re: sed not working on /proc files

Chip Salzenberg (chip@perlsupport.com)
Mon, 26 Apr 1999 17:17:10 -0400


According to Jeremy Fitzhardinge:
> On 26-Apr-99 Stefan Monnier wrote:
> > open("/proc/meminfo", O_RDONLY) = 3
> > fstat(3, {st_mode=0, st_size=0, ...}) = 0
> > mmap(0, 0, PROT_READ, MAP_PRIVATE, 3, 0) = 0
>
> This is the problem. It stats the file, mmaps 0 bytes from it and finishes
> with no action. Presumeably if the mmap failed or stat said the file isn't a
> regular file it would use normal read.

Hm. Would it be a Bad Thing for mmap to fail on /proc files that
don't report true sizes?

-- 
Chip Salzenberg      - a.k.a. -      <chip@perlsupport.com>
      "When do you work?"   "Whenever I'm not busy."

- 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/