---
name: "omirr"
section: "4"
platform: "linux"
package: "omirr"
version: "0.3-6"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/omirr"
---

# omirr(4)

online mirror kernel log device

## NAME

omirr - online mirror kernel log device

## SYNOPSIS

**/proc/omirr**

\#include \<linux/omirr.h\>

**int open("/proc/omirr",** **int** *oflag***);**

**ssize\_t read(int** *fildes***,** **void \****buf***,** **size\_t** *nbyte***);**

**int ioctl(int** *fildes***,** **int** *request***,** **/\*** *arg* **\*/ ...);**

## AVAILABILITY

Linux

## DESCRIPTION

**/proc/omirr** is a special device in the Linux /proc filesystem used by the [**in.omirrd**(8)](/in.omirrd/8.md) daemon to receive notifications about file system modifications. **/proc/omirr** supports the system calls [**open**(2)](/open/2.md), [**read**(2)](/read/2.md), [**select**(2)](/select/2.md), [**ioctl**(2)](/ioctl/2.md) and [**close**(2)](/close/2.md).

The **/proc/omirr** device may be opened only once concurrently. Therefore a second attempt to open the device blocks the calling process unless **O\_NONBLOCK** is specified in *oflags.* The device can only be opened in read-only mode, so **O\_RDONLY** must be passed in the  *oflags.*

**open()** accepts the following omirr-specific *oflags:*

- **O\_NONBLOCK**

  An open will return without delay even if **/proc/omirr** is already open. In addition, this flag may affect subsequent reads (see below).

- **O\_TRUNC**

  The data already available to be read will be discarded.

The behavior of  **read()** is also modified by the **O\_NONBLOCK** flag. If set, either via [**open**(2)](/open/2.md) or by a [**fcntl**(2)](/fcntl/2.md) call, and there is no data available, a read attempt returns **-1** with errno set to **EAGAIN.** If not set, the **read()** call blocks until data is available. When data is available,  **read()** succeeds and returns the number of bytes actually read and placed in the buffer; this number may be less than the number of bytes requested in the **read()** call.

**/proc/omirr** defines the following device-specific **ioctl()** calls, which are defined in **\<linux/omirr.h\>**:

- **OMIRRCLEARBUF**

  discards the data which is currently available for reading. The **ioctl** *arg* is ignored.

- **OMIRRGETBLOCKMODE**

  returns the current value of the block-mode. The **ioctl** *arg* is of type **(unsigned char \*)**. It is used to return the block-mode value. If block-mode is set, the ring buffer holding the log data cannot overflow, because the process generating the new notification is blocked. If block-mode is not set, the ring-buffer overflow will be detected and logged with a special protocol operation. Block-mode is unset by default.

- **OMIRRSETBLOCKMODE**

  sets block-mode to the value of *arg*, of type **(unsigned char)**. See  **OMIRRGETBLOCKMODE,** above, for a description of block-mode.

- **OMIRRGETBUFCOUNT**

  returns the number of bytes available for read. *arg* is of type **(unsigned long \*)**.

- **OMIRRGETDONTLOGMASK**

  returns the current value of the don't-log-mask. The **ioctl** *arg* is of type **(unsigned long \*)**. It is used to return the mask value. The following bits are defined in the mask:

  - **OMIRR\_DONTLOG\_PROC**

    suppress logging of file operations by the process which opened **/proc/omirr**

  - **OMIRR\_DONTLOG\_PPROC**

    suppress logging of file operations by the parent of the process which opened **/proc/omirr**

  - **OMIRR\_DONTLOG\_PGRP**

    suppress logging of file operations by the processes which are in the process group of the process which opened **/proc/omirr**

- **OMIRRSETDONTLOGMASK**

  sets the don't-log-mask to the value of *arg*, of type **(unsigned long)**. See **OMIRRGETDONTLOGMASK,** above, for a description of the don't-log-mask.

## RETURN VALUES

**open(),** **read(),** **select(),** **ioctl()** and **close()** return the values described in the manual pages [**open**(2)](/open/2.md), [**read**(2)](/read/2.md), [**select**(2)](/select/2.md), [**ioctl**(2)](/ioctl/2.md) and [**close**(2)](/close/2.md), respectively. Upon encountering an error, **-1** is returned with the ***errno*** variable set accordingly.

## ERRORS

In addition to the conditions listed in [**open**(2)](/open/2.md), **open()** can fail if one of the following conditions specific to the /proc/omirr device is met:

- **EINVAL**

  An open mode of **O\_WRONLY** or **O\_RDWR** was specified.

- **EWOULDBLOCK**

  **O\_NONBLOCK** is set and the **/proc/omirr** is already open.

- **EINTR**

  A signal was caught during the **open()** function.

In addition to the conditions listed in [**read**(2)](/read/2.md), **read()** can fail if one of the following conditions specific to the /proc/omirr device is met:

- **EAGAIN**

  Non-blocking I/O has been selected using **O\_NONBLOCK** and no data was immediately available for reading from **/proc/omirr**.

- **EINTR**

  A signal was caught during the read  operation and no data was transferred.

**ioctl()** can fail on the following conditions special to the **/proc/omirr** device:

- **EINVAL**

  *request* or *arg* is not valid for this device.

## FILES

- /proc/omirr

  omirr special proc filesystem device.

## SEE ALSO

[**in.omirrd**(8)](/in.omirrd/8.md), [**open**(2)](/open/2.md), [**read**(2)](/read/2.md), [**select**(2)](/select/2.md), [**ioctl**(2)](/ioctl/2.md), [**close**(2)](/close/2.md), [**fcntl**(2)](/fcntl/2.md)

## DIAGNOSTICS

- omirr\_log: buffer full - sleeping

  is an information message generated if block-mode is set and a process generating a new notification is put to sleep, because the notification does not fit into the ring buffer.

omirr: setting block mode without OMIRR\_DONTLOG\_PROC may result in dead lock

is a warning message generated if block-mode is set using [**ioctl**(2)](/ioctl/2.md) without setting the don't-log-mask to include **OMIRR\_DONTLOG\_PROC** before. See **WARNINGS,** below, for an explanation.

## WARNINGS

It is dangerous to switch on block-mode without including  **OMIRR\_DONTLOG\_PROC** in the don't-log-mask, because that may result in a dead-lock condition where the process that opened **/proc/omirr** is blocked in a file system operation because the ring buffer is full, and is therefore unable to read data from the ring buffer. To warn about this condition, the kernel generates a warning message, see  **DIAGNOSTICS,** above.

## AUTHOR

Andreas Luik \<luik@pharao.s.bawue.de\>
