TIMEVAL_TO_TIMESPEC(3)

TIMEVAL_TO_TIMESPEC3

Convert between time structures

Usage

#define _GNU_SOURCE
#include <sys/time.h>

void TIMEVAL_TO_TIMESPEC(const struct timeval *tv, struct timespec *ts); void TIMESPEC_TO_TIMEVAL(struct timeval *tv, const struct timespec *ts);

Overview

These macros convert from a timeval(3type) to a timespec(3type) structure, and vice versa, respectively.

This is especially useful for writing interfaces that receive a type, but are implemented with calls to functions that receive the other one.

Releases

2 releases since Debian 13 (Trixie); the text changed 1 time.

  1. 13
  2. Arch

Standards

GNU, BSD.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.