---
name: "function::set_kernel_string_n"
section: "3stap"
platform: "linux"
package: "systemtap-doc"
version: "5.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/function::set_kernel_string_n"
---

# function::set\_kernel\_string\_n(3stap)

Writes a string of given length to kernel memory

## NAME

function::set\_kernel\_string\_n - Writes a string of given length to kernel memory

## SYNOPSIS

```
    set_kernel_string_n(addr:long,n:long,val:string)
```

## ARGUMENTS

*addr*

The kernel address to write the string to

*n*

The maximum length of the string

*val*

The string which is to be written

## DESCRIPTION

Writes the given string up to a maximum given length to a given kernel memory address. Reports an error on string copy fault. Requires the use of guru mode (-g).

## SEE ALSO0

[*tapset::conversions-guru*(3stap)](/tapset::conversions-guru/3stap.md)
