What are locks?

# 15 What are locks?

Contents of this section

Locks are simply a file saying that a particular device is in use. They are kept in `/usr/spool/uucp`. Locks are named `LCK..<name>`, where `<name>` is either a device name, or a UUCP site name. Certain processes create these locks so that they can have exclusive access to devices, for instance if you dial out on your modem, a lock will appear telling other processes that someone is using the modem already. Locks mainly contain the PID of the process that has locked the device. Most programs look at the lock, and try to determine if that lock is still valid by checking the process table for the process that has locked the device. If the lock is found to be valid, the program should exit. If not, some programs remove the stale lock, and use the device, creating their own lock in the process.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter