lock file question

Rusty Russell rusty at au1.ibm.com
Tue Nov 4 12:39:27 EST 2003


In message <1067895134.13400.26.camel at verve> you write:
>
> As part of a new RTAS interface, I'm writing a library that needs to
> manage mmap() use of a phys mem region in /dev/mem/.  If library user B
> requires an mmap()'ed buffer of a subset of this memory, then the
> library should ensure that it does not hand out a region being used by
> library user A.
>
> The current plan is to create a lock file "/var/lock/LCK..librtas", and
> use byte-range locks to manage the use of buffers that fall within this
> region.

Yep, that's the most sane idea.  You don't need to use ranges at all
though, since there's little point in having more than one user at a
time, even when it's possible.

Cheers,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list