URL: http://www.firstbasesoftware.com/man/man3/fb_sync.htm
Last modified: 12 September 1995
Copyright © by FirstBase Software.
[
Index of Contents] [
FirstBase RDBMS Overview]
fb_sync(db)
fb_database *db;
By using fb_sync with fb_lock, the FirstBase system provides safe access to changing database objects, even under a Network File System (NFS).
For example, if multiple processes need to share an index, like the FirstBase tool dbvedit, then calls to gethead and getxhead will be needed, and maybe even getxrec. To ensure that data within the database is unchanging during these calls, this critical section can be protected by locking record zero. Fb_sync is then used to force the current process to update each open file descriptor.
fb_lock(0, db, FB_WAIT);
fb_sync(d);
fb_getxhead(db->ihfd, &db->bsmax, &db->bsend);
fb_gethead(db);
if (fb_getxrec(key, d) == FB_AOK)
...
fb_unlock(0, db);