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

# KEYCTL\_UPDATE(2const)

update a key's data payload

## NAME

KEYCTL\_UPDATE - update a key's data payload

## LIBRARY

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

## SYNOPSIS

```
#include <linux/keyctl.h>  /* Definition of KEY* constants */
#include <sys/syscall.h>   /* Definition of SYS_* constants */
#include <unistd.h>
```

**long syscall(**size\_t size;              **SYS\_keyctl, KEYCTL\_UPDATE, key\_serial\_t** *key***,**              **void** *payload***\[***size***\], size\_t** *size***);**

## DESCRIPTION

Update a key's data payload.

*key* specifies the ID of the key to be updated. *payload* points to the new payload and *size* contains the new payload size in bytes.

The caller must have *write* permission on the key specified and the key type must support updating.

A negatively instantiated key (see [**KEYCTL\_REJECT**(2const)](/KEYCTL_REJECT/2const.md)) can be positively instantiated with this operation.

## RETURN VALUE

On success, 0 is returned.

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

## ERRORS

- The key type does not support updating.

  ## VERSIONS

A wrapper is provided in the *libkeyutils* library: [**keyctl\_update**(3)](/keyctl_update/3.md).

## STANDARDS

Linux.

## HISTORY

Linux 2.6.10.

## SEE ALSO

[**keyctl**(2)](/keyctl/2.md), [**keyctl\_update**(3)](/keyctl_update/3.md)
