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

# PR\_SET\_ENDIAN(2const)

set endianness of the calling process

## NAME

PR\_SET\_ENDIAN - set endianness of the calling process

## LIBRARY

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

## SYNOPSIS

```
#include <linux/prctl.h>  /* Definition of PR_* constants */
#include <sys/prctl.h>
```

**int prctl(PR\_SET\_ENDIAN, long** *endianness***);**

## DESCRIPTION

Set the endianness of the calling process to the value given in *endianness*, which should be one of the following: **PR\_ENDIAN\_BIG**, **PR\_ENDIAN\_LITTLE**, or **PR\_ENDIAN\_PPC\_LITTLE** (PowerPC pseudo little endian).

## RETURN VALUE

On success, 0 is returned. On error, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

- **EINVAL**

  *endianness* is not a valid value.

## STANDARDS

Linux. PowerPC only.

## HISTORY

Linux 2.6.18 (PowerPC).

## SEE ALSO

[**prctl**(2)](/prctl/2.md), [**PR\_GET\_ENDIAN**(2const)](/PR_GET_ENDIAN/2const.md)
