---
name: "Fcntl"
section: "3pm"
platform: "linux"
package: "perl-5.004-doc"
version: "5.004.05-6"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/Fcntl/3pm"
---

# Fcntl(3pm)

load the C Fcntl.h defines

## NAME

Fcntl - load the C Fcntl.h defines

## SYNOPSIS

```
    use Fcntl;
    use Fcntl qw(:DEFAULT :flock);
```

## DESCRIPTION

This module is just a translation of the C *fnctl.h* file. Unlike the old mechanism of requiring a translated *fnctl.ph* file, this uses the **h2xs** program (see the Perl source distribution) and your native C compiler.  This means that it has a  far more likely chance of getting the numbers right.

## NOTE

Only `#define` symbols get translated; you must still correctly pack up your own arguments to pass as args for locking functions, etc.

## EXPORTED SYMBOLS

By default your system's F\_\* and O\_\* constants (eg, F\_DUPFD and O\_CREAT) and the FD\_CLOEXEC constant are exported into your namespace.

You can request that the *flock()* constants (LOCK\_SH, LOCK\_EX, LOCK\_NB and LOCK\_UN) be provided by using the tag `:flock`.  See the *Exporter* manpage.

You can request that the old constants (FAPPEND, FASYNC, FCREAT, FDEFER, FEXCL, FNDELAY, FNONBLOCK, FSYNC, FTRUNC) be provided for compatibility reasons by using the tag `:Fcompat`.  For new applications the newer versions of these constants are suggested (O\_APPEND, O\_ASYNC, O\_CREAT, O\_DEFER, O\_EXCL, O\_NDELAY, O\_NONBLOCK, O\_SYNC, O\_TRUNC).

Please refer to your native *fcntl()* and *open()* documentation to see what constants are implemented in your system.
