---
name: "asprintf_l"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/asprintf_l"
---

# asprintf\_l(3)

formatted output conversion

## NAME

**printf\_l**, **asprintf\_l**, **fprintf\_l**, **snprintf\_l**, **sprintf\_l**, **vasprintf\_l**, **vfprintf\_l**, **vprintf\_l**, **vsnprintf\_l**, **vsprintf\_l** – formatted output conversion

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<stdio.h\>**

**#include \<xlocale.h\>**

*int*\

**printf\_l**(*locale\_t loc*, *const char \* restrict format*, *...*);

*int*\

**asprintf\_l**(*char \*\*ret*, *locale\_t loc*, *const char \* format*, *...*);

*int*\

**fprintf\_l**(*FILE \* restrict stream*, *locale\_t loc*, *const char \* restrict format*, *...*);

*int*\

**snprintf\_l**(*char \* restrict str*, *size\_t size*, *locale\_t loc*, *const char \* restrict format*, *...*);

*int*\

**sprintf\_l**(*char \* restrict str*, *locale\_t loc*, *const char \* restrict format*, *...*);

*int*\

**vasprintf\_l**(*char \*\*ret*, *locale\_t loc*, *const char \*format*, *va\_list ap*);

*int*\

**vfprintf\_l**(*FILE \* restrict stream*, *locale\_t loc*, *const char \* restrict format*, *va\_list ap*);

*int*\

**vprintf\_l**(*locale\_t loc*, *const char \* restrict format*, *va\_list ap*);

*int*\

**vsnprintf\_l**(*char \* restrict str*, *size\_t size*, *locale\_t loc*, *const char \* restrict format*, *va\_list ap*);

*int*\

**vsprintf\_l**(*char \* restrict str*, *locale\_t loc*, *const char \* restrict format*, *va\_list ap*);

## DESCRIPTION

The above functions are used to convert formatted output in the locale *loc*. They behave in the same way as the versions without the \_l suffix, but use the specified locale rather than the global or per-thread locale. See the specific manual pages for more information.

## SEE ALSO

[printf(3)](/printf/3.md), [xlocale(3)](/xlocale/3.md)

## STANDARDS

These functions do not conform to any specific standard so they should be considered as non-portable local extensions.

## HISTORY

These functions first appeared in Darwin and were first implemented in FreeBSD 9.1.
