record locking

Phil Edwards phil@jaj.com
Mon Mar 25 14:57:00 GMT 2002


On Sun, Mar 24, 2002 at 06:03:53PM +0100, Matthias Weiss wrote:
> AFAIK I have to do an additional "open" call to the
> libc API to get a file descriptor that allows me
> to use flock.

With recent versions of the library you can use an extension, fstream::fd(),
to obtain the underlying file descriptor.


> So my request would be to integrate this in the fstream
> class as an extension or to add a member function that 
> returns the file descriptor.

Or you could extend fstream (or one of the buffer classes) to do the
locking for you at appropriate times.  That way the "non-standard-ness"
would be explicitly in your code, rather than depending on a particular
library extension.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams



More information about the Libstdc++ mailing list