---
name: "PAPI_write"
section: "3"
platform: "linux"
package: "libpapi-dev"
version: "7.1.0-5+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PAPI_write"
---

# PAPI\_write(3)

Write counter values into counters.

## NAME

PAPI\_write - Write counter values into counters.

## SYNOPSIS

## Detailed Description

**Parameters**

*EventSet* an integer handle for a PAPI event set as created by **PAPI\_create\_eventset** \
 *\*values* an array to hold the counter values of the counting events

**Return values**

*PAPI\_ENOEVST* The EventSet specified does not exist. \
 *PAPI\_ECMP* **PAPI\_write()** is not implemented for this architecture. \
 *PAPI\_ESYS* The EventSet is currently counting events and the component could not change the values of the running counters.

**PAPI\_write()** writes the counter values provided in the array values into the event set EventSet. The virtual counters managed by the PAPI library will be set to the values provided. If the event set is running, an attempt will be made to write the values to the running counters. This operation is not permitted by all components and may result in a run-time error.

**See also**

**PAPI\_read**

## Author

Generated automatically by Doxygen for PAPI from the source code.
