Groups | Search | Server Info | Login | Register


Groups > comp.os.linux.development.system > #108

Re: per process llseek offset

From Rainer Weikusat <rweikusat@mssgmbh.com>
Newsgroups comp.os.linux.development.system
Subject Re: per process llseek offset
Date 2011-05-02 13:07 +0100
Message-ID <87liypjofg.fsf@sapphire.mobileactivedefense.com> (permalink)
References <51ad5eed-fee6-4007-aeba-35be2d9fd80d@m13g2000yqb.googlegroups.com>

Show all headers | View raw


"dr.oktopus" <blindwilly@freeonline.zzn.com> writes:
> as you know offset in the file structure is shared amongst father and
> child processes. How can I get a per-process specific offset so that
> a child lseek is not influenced by the same operation done by the
> father process?

Assuming that your inherited file descriptor is stored in a variable
named fd (and the type of file it refers to supports this), opening
the file /proc/self/<fd> (eg /proc/self/3 if fd == 3) results in a
file descriptor referring to the same file but with a newly create
file structure.

Back to comp.os.linux.development.system | Previous | NextPrevious in thread | Find similar


Thread

per process llseek offset "dr.oktopus" <blindwilly@freeonline.zzn.com> - 2011-05-01 22:41 -0700
  Re: per process llseek offset David Schwartz <davids@webmaster.com> - 2011-05-02 03:50 -0700
    Re: per process llseek offset "dr.oktopus" <blindwilly@freeonline.zzn.com> - 2011-05-02 15:39 -0700
      Re: per process llseek offset Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-05-02 20:25 -0600
  Re: per process llseek offset Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-05-02 13:07 +0100

csiph-web