This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: record locking


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]