---
name: "SYSCALL_DEFINE2"
section: "9"
platform: "linux"
package: "linux-manual-2.6.26"
version: "2.6.26-29"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/SYSCALL_DEFINE2"
---

# SYSCALL\_DEFINE2(9)

flock system call.

## NAME

SYSCALL\_DEFINE2 - flock system call.

## SYNOPSIS

**SYSCALL\_DEFINE2(***flock***, unsigned** *int***,** *fd***, unsigned** *int***,** *cmd***);**

## ARGUMENTS

*flock*

\-- undescribed --

*int*

\-- undescribed --

*fd*

the file descriptor to lock.

*int*

\-- undescribed --

*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
