---
name: "rtapi_snprintf"
section: "3rtapi"
platform: "linux"
package: "linuxcnc-uspace-dev"
version: "1:2.9.4-2+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rtapi_snprintf"
---

# rtapi\_snprintf(3rtapi)

Perform snprintf-like string formatting

## NAME

rtapi\_snprintf, rtapi\_vsnprintf - Perform snprintf-like string formatting

## SYNTAX

 int rtapi\_snprintf(char \**buf*, unsigned long int *size*, const char \**fmt*, *...*)

 int rtapi\_vsnprintf(char \**buf*, unsigned long int *size*, const char \**fmt*, va\_list *apfB)*

## ARGUMENTS

*As for [snprintf(3)](/snprintf/3.md)* or *[vsnprintf(3)](/vsnprintf/3.md)*.

## DESCRIPTION

These functions work like the standard C printf functions, except that a reduced set of formatting operations are supported.

In particular: formatting of long long values is not supported.  Formatting of floating-point values is done as though with %A even when other formats like %f are specified.

## REALTIME CONSIDERATIONS

May be called from non-realtime, init/cleanup, and realtime code.

## RETURN VALUE

The number of characters written to *buf*.

## SEE ALSO

**[printf(3)](/printf/3.md)**
