IP_MTU(2const)

IP_MTU2const

Path maximum transmission unit size

Usage

#include <netinet/in.h>  /* Definition of IP* constants */
#include <sys/socket.h>

int getsockopt(int sockfd, IPPROTO_IP, IP_MTU, int *val, sizeof(int));

Library

Standard C library (libc, -lc)

Overview

Retrieve the current known path MTU of the current socket.

IP_MTU is valid only for getsockopt(2), and can be employed only when the socket has been connected.

Errors

See IPPROTO_IP(2const). See getsockopt(2). See ip(7).

Standards

Linux.

History

Linux 2.2.

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