---
name: "IP_MTU"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/IP_MTU"
---

# IP\_MTU(2const)

path maximum transmission unit size

## NAME

IP\_MTU - path maximum transmission unit size

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

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

**int getsockopt(int** *sockfd***, IPPROTO\_IP, IP\_MTU,**                **int \****val***, sizeof(int));**

## DESCRIPTION

Retrieve the current known path MTU of the current socket.

**IP\_MTU** is valid only for [**getsockopt**(2)](/getsockopt/2.md), and can be employed only when the socket has been connected.

## ERRORS

See [**IPPROTO\_IP**(2const)](/IPPROTO_IP/2const.md). See [**getsockopt**(2)](/getsockopt/2.md). See [**ip**(7)](/ip/7.md).

## STANDARDS

Linux.

## HISTORY

Linux 2.2.

## SEE ALSO

[**IPPROTO\_IP**(2const)](/IPPROTO_IP/2const.md), [**getsockopt**(2)](/getsockopt/2.md), [**ip**(7)](/ip/7.md)
