{
    "mode": "man",
    "parameter": "proc_locks",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/proc_locks/5/json",
    "generated": "2026-10-07T20:15:20Z",
    "sections": {
        "NAME": {
            "content": "/proc/locks - current file locks and leases\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "/proc/locks\nThis file shows current file locks (flock(2) and fcntl(2)) and leases (fcntl(2)).\n\nAn example of the content shown in this file is the following:\n\n1: POSIX  ADVISORY  READ  5433 08:01:7864448 128 128\n2: FLOCK  ADVISORY  WRITE 2001 08:01:7864554 0 EOF\n3: FLOCK  ADVISORY  WRITE 1568 00:2f:32388 0 EOF\n4: POSIX  ADVISORY  WRITE 699 00:16:28457 0 EOF\n5: POSIX  ADVISORY  WRITE 764 00:16:21448 0 0\n6: POSIX  ADVISORY  READ  3548 08:01:7867240 1 1\n7: POSIX  ADVISORY  READ  3548 08:01:7865567 1826 2335\n8: OFDLCK ADVISORY  WRITE -1 08:01:8713209 128 191\n\nThe fields shown in each line are as follows:\n\n[1]  The ordinal position of the lock in the list.\n\n[2]  The lock type.  Values that may appear here include:\n\nFLOCK  This is a BSD file lock created using flock(2).\n\nOFDLCK This is an open file description (OFD) lock created using fcntl(2).\n\nPOSIX  This is a POSIX byte-range lock created using fcntl(2).\n\n[3]  Among the strings that can appear here are the following:\n\nADVISORY\nThis is an advisory lock.\n\nMANDATORY\nThis is a mandatory lock.\n\n[4]  The type of lock.  Values that can appear here are:\n\nREAD   This is a POSIX or OFD read lock, or a BSD shared lock.\n\nWRITE  This is a POSIX or OFD write lock, or a BSD exclusive lock.\n\n[5]  The PID of the process that owns the lock.\n\nBecause OFD locks are not owned by a single process (since multiple processes may\nhave file descriptors that refer to the same open file description), the value -1\nis  displayed  in this field for OFD locks.  (Before Linux 4.14, a bug meant that\nthe PID of the process that initially acquired the lock was displayed instead  of\nthe value -1.)\n\n[6]  Three  colon-separated  subfields  that identify the major and minor device ID of\nthe device containing the filesystem where the locked file resides,  followed  by\nthe inode number of the locked file.\n\n[7]  The  byte offset of the first byte of the lock.  For BSD locks, this value is al‐\nways 0.\n\n[8]  The byte offset of the last byte of the lock.  EOF in this field means  that  the\nlock  extends  to  the end of the file.  For BSD locks, the value shown is always\nEOF.\n\nSince Linux 4.9, the list of locks shown in /proc/locks is filtered to show  just  the\nlocks  for  the  processes  in the PID namespace (see pidnamespaces(7)) for which the\n/proc filesystem was mounted.  (In the initial PID namespace, there is no filtering of\nthe records shown in this file.)\n\nThe lslocks(8) command provides a bit more information about each lock.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "proc(5)\n\nLinux man-pages 6.7                          2023-11-19                                proclocks(5)",
            "subsections": []
        }
    },
    "summary": "/proc/locks - current file locks and leases",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "proc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
        }
    ]
}