Next: , Previous: , Up: Top   [Contents][Index]


19 File Locking

With locking disabled (if gdbm_open was called with GDBM_NOLOCK), the user may want to perform their own file locking on the database file in order to prevent multiple writers operating on the same file simultaneously.

In order to support this, the gdbm_fdesc routine is provided.

gdbm interface: int gdbm_fdesc (GDBM_FILE dbf)

Returns the file descriptor of the database dbf. This value can be used as an argument to flock, lockf or similar calls.