Peng Yu wrote: >> So the fundamental C API that unix_os.c is based on is >> the only following but nothing else? >> [ followed by links to *nix C API fcntl(…) docs ]
The (C and fundamental) API you cite is the interface provided for applications running on Unix-like operating systems to lock files in various ways. Applications can use that API if they can pass the right parameters to the OS-provided entry point using C calling convention. This is but tangentially related to “how lock is implemented upon write”, presumably in SQLite, (the subject of this thread, I guess.) I say “tangentially” because there is far more to SQLite’s database locking than managing an OS-provided file lock. I can see this at a glance by looking at fcnt() calls (or their macro stand-ins) in sqlite3.c . You appear to want to understand SQLite implements locking, apparently without reading the (C) code which effects that behavior. I am not surprised than nobody wants to recast all that logic for you into a language you are willing and/or able to read. It is complex, and changes among the platforms targeted by SQLite. And it hardly matters to most SQLite users *how* it is implemented; their concern is how it works, which is well documented (as others have mentioned), and that it works well and reliably. I notice that you have ignored repeated requests for insight into why you have made your inquiry. People who may be able to help you with your objective ask for such information because, often, that leads to or permits a more direct solution to your actual problem. Certainly in this case, where the Pascal translation of many lines of C would take hours to generate, a more direct solution is probably going to be the only one likely to be offered. Cheers, - Larry Brasfield _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users