---
name: "rtl_setclockmode"
section: "3"
platform: "linux"
package: "rtlinux"
version: "2.0rel-1"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/rtl_setclockmode"
---

# rtl\_setclockmode(3)

set the RTL clock mode

## NAME

rtl\_setclockmode - set the RTL clock mode

## SYNOPSIS

**#include \<rtl\_sched.h\>**

**int rtl\_setclockmode (clockid\_t clock, int mode, hrtime\_t mode\_param);**

## DESCRIPTION

This function is a non-portable Real-Time Linux extension.

**rtl\_setclockmode** sets the mode of the specified clock. The allowed modes depend on the clock. Generally, the following modes are supported:

- **RTL\_CLOCK\_MODE\_ONESHOT**

  The clock is in the oneshot mode. The mode\_param is ignored.

- **RTL\_CLOCK\_MODE\_PERIODIC**

  The clock is in the periodic mode. The mode\_param is the period expressed in nanoseconds.

## RETURN VALUE

This function returns 0 on success and a non-zero error code on error.

## ERRORS

**EINVAL** the mode or the parameter is invalid.

## AUTHOR

Michael Barabanov \<baraban@fsmlabs.com\>

## SEE ALSO

[**clock\_gettime**(3)](/clock_gettime/3.md), [**rtl\_getschedclock**(3)](/rtl_getschedclock/3.md), [**clock\_gethrtime**(3)](/clock_gethrtime/3.md)
