---
name: "mbsinit"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/mbsinit"
---

# mbsinit(3)

test for initial shift state

## NAME

mbsinit - test for initial shift state

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <wchar.h>
```

**int mbsinit(const mbstate\_t \****ps***);**

## DESCRIPTION

The function **mbsinit**() tests whether *\*ps* corresponds to an initial shift state.

## RETURN VALUE

**mbsinit**() returns nonzero if *\*ps* is an initial shift state, or if *ps* is NULL. Otherwise, it returns 0.

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **mbsinit**() | Thread safety | MT-Safe |

## STANDARDS

C11, POSIX.1-2008.

## HISTORY

POSIX.1-2001, C99.

## NOTES

The behavior of **mbsinit**() depends on the **LC\_CTYPE** category of the current locale.

## SEE ALSO

[**mbstate\_t**(3type)](/mbstate_t/3type.md), [**mbrlen**(3)](/mbrlen/3.md), [**mbrtowc**(3)](/mbrtowc/3.md), [**mbsrtowcs**(3)](/mbsrtowcs/3.md), [**wcrtomb**(3)](/wcrtomb/3.md), [**wcsrtombs**(3)](/wcsrtombs/3.md)
