---
name: "sysdecode_fcntl_fileflags"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/sysdecode_accessmode"
---

# sysdecode\_fcntl\_fileflags(3)

print name of various bitmask values

Part of [sysdecode\_accessmode(3)](/sysdecode_accessmode/3.md).

## NAME

**sysdecode\_mask**, **sysdecode\_accessmode**, **sysdecode\_atflags**, **sysdecode\_capfcntlrights**, **sysdecode\_close\_range\_flags**, **sysdecode\_fcntl\_fileflags**, **sysdecode\_fileflags**, **sysdecode\_filemode**, **sysdecode\_flock\_operation**, **sysdecode\_mlockall\_flags**, **sysdecode\_mmap\_flags**, **sysdecode\_mmap\_prot**, **sysdecode\_mount\_flags**, **sysdecode\_msg\_flags**, **sysdecode\_msync\_flags**, **sysdecode\_open\_flags**, **sysdecode\_pipe2\_flags**, **sysdecode\_pollfd\_events**, **sysdecode\_reboot\_howto**, **sysdecode\_rfork\_flags**, **sysdecode\_semget\_flags**, **sysdecode\_sendfile\_flags**, **sysdecode\_shmat\_flags**, **sysdecode\_sctp\_nxt\_flags**, **sysdecode\_sctp\_rcv\_flags**, **sysdecode\_sctp\_snd\_flags**, **sysdecode\_socket\_type**, **sysdecode\_thr\_create\_flags**, **sysdecode\_umtx\_cvwait\_flags**, **sysdecode\_umtx\_rwlock\_flags**, **sysdecode\_vmprot**, **sysdecode\_wait4\_options**, **sysdecode\_wait6\_options** – print name of various bitmask values

## LIBRARY

library “libsysdecode”

## SYNOPSIS

**#include \<sysdecode.h\>**

*bool*\

**sysdecode\_access\_mode**(*FILE \*fp*, *int mode*, *int \*rem*);

*bool*\

**sysdecode\_atflags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_cap\_fcntlrights**(*FILE \*fp*, *uint32\_t rights*, *uint32\_t \*rem*);

*bool*\

**sysdecode\_close\_range\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_fcntl\_fileflags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_fileflags**(*FILE \*fp*, *fflags\_t flags*, *fflags\_t \*rem*);

*bool*\

**sysdecode\_filemode**(*FILE \*fp*, *int mode*, *int \*rem*);

*bool*\

**sysdecode\_flock\_operation**(*FILE \*fp*, *int operation*, *int \*rem*);

*bool*\

**sysdecode\_mlockall\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_mmap\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_mmap\_prot**(*FILE \*fp*, *int prot*, *int \*rem*);

*bool*\

**sysdecode\_mount\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_msg\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_msync\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_open\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_pipe2\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_pollfd\_events**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_reboot\_howto**(*FILE \*fp*, *int howto*, *int \*rem*);

*bool*\

**sysdecode\_rfork\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_sctp\_nxt\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_sctp\_rcv\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_sctp\_snd\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_semget\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_sendfile\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_shmat\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_socket\_type**(*FILE \*fp*, *int type*, *int \*rem*);

*bool*\

**sysdecode\_thr\_create\_flags**(*FILE \*fp*, *int flags*, *int \*rem*);

*bool*\

**sysdecode\_umtx\_cvwait\_flags**(*FILE \*fp*, *u\_long flags*, *u\_long \*rem*);

*bool*\

**sysdecode\_umtx\_rwlock\_flags**(*FILE \*fp*, *u\_long flags*, *u\_long \*rem*);

*bool*\

**sysdecode\_vmprot**(*FILE \*fp*, *int type*, *int \*rem*);

*bool*\

**sysdecode\_wait4\_options**(*FILE \*fp*, *int options*, *int \*rem*);

*bool*\

**sysdecode\_wait6\_options**(*FILE \*fp*, *int options*, *int \*rem*);

## DESCRIPTION

The **sysdecode\_mask** functions are used to generate a text description of an integer value built from a mask of bitfields. The text description lists the C macros for field values joined by pipe ‘\|’ characters matching the format used in C source code. Most of the values decoded by these functions are passed as arguments to system calls, though some of these values are used internally in the kernel.

Each function writes the text description to *fp*. The second argument should contain the integer value to be decoded. The *rem* argument is set to the value of any bits that were not decoded (bit fields that do not have a corresponding C macro). *rem* may be set to NULL if the caller does not need this value. Each function returns true if any bit fields in the value were decoded and false if no bit fields were decoded.

Most of these functions decode an argument passed to a system call:

| | | |
| --- | --- | --- |
| **Function** | **System** **Call** | **Argument** |
| **sysdecode\_access\_mode**() | [access(2)](/access/2.md) | *mode* |
| **sysdecode\_atflags**() | [chflagsat(2)](/chflagsat/2.md), [fstatat(2)](/fstatat/2.md) | *atflag*, *flag* |
| **sysdecode\_cap\_fcntlrights**() | [cap\_fcntls\_limit(2)](/cap_fcntls_limit/2.md) | *fcntlrights* |
| **sysdecode\_fileflags**() | [chflags(2)](/chflags/2.md) | *flags* |
| **sysdecode\_filemode**() | [chmod(2)](/chmod/2.md), [open(2)](/open/2.md) | mode |
| **sysdecode\_flock\_operation**() | [flock(2)](/flock/2.md) | *operation* |
| **sysdecode\_mlockall\_flags**() | [mlockall(2)](/mlockall/2.md) | *flags* |
| **sysdecode\_mmap\_flags**() | [mmap(2)](/mmap/2.md) | *flags* |
| **sysdecode\_mmap\_prot**() | [mmap(2)](/mmap/2.md) | *prot* |
| **sysdecode\_mount\_flags**() | [mount(2)](/mount/2.md) | *flags* |
| **sysdecode\_msg\_flags**() | [recv(2)](/recv/2.md), [send(2)](/send/2.md) | *flags* |
| **sysdecode\_msync\_flags**() | [msync(2)](/msync/2.md) | *flags* |
| **sysdecode\_open\_flags**() | [open(2)](/open/2.md) | *flags* |
| **sysdecode\_pipe2\_flags**() | pipe2 | *flags* |
| **sysdecode\_reboot\_howto**() | [reboot(2)](/reboot/2.md) | *howto* |
| **sysdecode\_rfork\_flags**() | [rfork(2)](/rfork/2.md) | *flags* |
| **sysdecode\_semget\_flags**() | [semget(2)](/semget/2.md) | *flags* |
| **sysdecode\_sendfile\_flags**() | [sendfile(2)](/sendfile/2.md) | *flags* |
| **sysdecode\_shmat\_flags**() | [shmat(2)](/shmat/2.md) | *flags* |
| **sysdecode\_socket\_type**() | [socket(2)](/socket/2.md) | *type* |
| **sysdecode\_thr\_create\_flags**() | thr\_create(2) | *flags* |
| **sysdecode\_wait4\_options**() | [wait4(2)](/wait4/2.md) | *options* |
| **sysdecode\_wait6\_options**() | [wait6(2)](/wait6/2.md) | *options* |

Other functions decode the values described below:

- **sysdecode\_fcntl\_fileflags**()

  The file flags used with the F\_GETFL and F\_SETFL [fcntl(2)](/fcntl/2.md) commands.

- **sysdecode\_pollfd\_events**()

  The *events* and *revents* members of a *struct* *pollfd*.

- **sysdecode\_sctp\_nxt\_flags**()

  The *nxt\_flags* member of a *struct* *sctp\_nxtinfo*.

- **sysdecode\_sctp\_rcv\_flags**()

  The *rcv\_flags* member of a *struct* *sctp\_rcvinfo*.

- **sysdecode\_sctp\_snd\_flags**()

  The *snd\_flags* member of a *struct* *sctp\_sndinfo*.

- **sysdecode\_umtx\_cvwait\_flags**()

  The *val* argument to [\_umtx\_op(2)](/_umtx_op/2.md) for UMTX\_OP\_CV\_WAIT operations.

- **sysdecode\_umtx\_rwlock\_flags**()

  The *val* argument to [\_umtx\_op(2)](/_umtx_op/2.md) for UMTX\_OP\_RW\_RDLOCK operations.

- **sysdecode\_vmprot**()

  The memory protection flags stored in *vm\_prot\_t* variables.

## RETURN VALUES

The **sysdecode\_mask** functions return true if any bit fields in the value were decoded and false if no bit fields were decoded.

## SEE ALSO

[sysdecode(3)](/sysdecode/3.md), [sysdecode\_enum(3)](/sysdecode_enum/3.md)
