frontend.txt 1009 B

12345678910111213141516171819202122232425
  1. Frontend Interfaces
  2. ===================
  3. This file will try to document some of the interfaces that dpkg makes
  4. available to frontends or that expects them to use, which are currently
  5. not covered by any other type of documentation.
  6. Database Locking
  7. ----------------
  8. Any frontend needing to make sure no write operation is currently happening,
  9. should lock the dpkg database by locking the file «<admindir>/lock» using
  10. file record locks (i.e. fcntl(2) advisory locking). The whole file should
  11. be locked, as that's the most portable way to perform this operation; this
  12. can be achieved by using start=0, len=0 and whence=SEEK_SET.
  13. Take into account there will be a race condition between the frontend
  14. unlocking the database and the invoked dpkg locking it again, in which
  15. another process could lock it.
  16. In the future this functionality will be available through a shared libdpkg
  17. library, and all frontends will be expected to switch to that instead,
  18. because this will fix the aforementioned race condition.