$linuxjunkies
>

time namespace

also: CLOCK_BOOTTIME namespace, CLOCK_MONOTONIC namespace, timens

A Linux namespace that isolates the system time and clock settings for processes, allowing different groups of processes to perceive different times or have independent clock adjustments.

The time namespace (CLOCK_BOOTTIME and CLOCK_MONOTONIC) is a namespace type introduced in Linux 5.6 that allows processes in different namespaces to have independent views of system time. This is useful for containerization and process isolation where you want containers or process groups to have their own logical time without affecting the host or other containers.

For example, you can create a container with a time namespace that appears to have booted at a different time or been paused and resumed, independent of the actual system time. This is particularly valuable in testing scenarios where you need to simulate time changes or in distributed systems where clock coordination matters.

Time namespaces work alongside other namespace types (PID, network, mount, etc.) and are manipulated using standard namespace tools like unshare, nsenter, and the clone() system call with the CLONE_NEWTIME flag.

Related terms