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

# uselocale(3)

Sets a thread-local locale

## NAME

**uselocale** – Sets a thread-local locale

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

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

*locale\_t*\

**uselocale**(*locale\_t locale*);

## DESCRIPTION

Specifies the locale for this thread to use. Specifying *LC\_GLOBAL\_LOCALE* disables the per-thread locale, while NULL returns the current locale without setting a new one.

## RETURN VALUES

Returns the previous locale, or LC\_GLOBAL\_LOCALE if this thread has no locale associated with it.

## SEE ALSO

[duplocale(3)](/duplocale/3.md), [freelocale(3)](/freelocale/3.md), [localeconv(3)](/localeconv/3.md), [newlocale(3)](/newlocale/3.md), [querylocale(3)](/querylocale/3.md), [xlocale(3)](/xlocale/3.md)

## STANDARDS

This function conforms to IEEE Std 1003.1-2008 (“POSIX.1”).
