---
name: "sys_flock"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/sys_flock"
---

# sys\_flock(9)

flock system call.

## NAME

sys\_flock - **flock** system call.

## SYNOPSIS

**long sys\_flock(unsigned int** *fd***, unsigned int** *cmd***);**

## ARGUMENTS

*fd*

the file descriptor to lock.

*cmd*

the type of lock to apply.

## DESCRIPTION

Apply a **FL\_FLOCK** style lock to an open file descriptor. The *cmd* can be one of

**LOCK\_SH** -- a shared lock.

**LOCK\_EX** -- an exclusive lock.

**LOCK\_UN** -- remove an existing lock.

**LOCK\_MAND** -- a \`mandatory' flock. This exists to emulate Windows Share Modes.

**LOCK\_MAND** can be combined with **LOCK\_READ** or **LOCK\_WRITE** to allow other processes read and write access respectively.

## COPYRIGHT
