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

# fputwc\_unlocked(3)

nonlocking stdio functions

Part of [unlocked\_stdio(3)](/unlocked_stdio/3.md).

## NAME

getc\_unlocked, getchar\_unlocked, putc\_unlocked, putchar\_unlocked - nonlocking stdio functions

## LIBRARY

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

## SYNOPSIS

```
#include <stdio.h>
```

**int getc\_unlocked(FILE \****stream***);** **int getchar\_unlocked(void);** **int putc\_unlocked(int** *c***, FILE \****stream***);** **int putchar\_unlocked(int** *c***);**

**void clearerr\_unlocked(FILE \****stream***);** **int feof\_unlocked(FILE \****stream***);** **int ferror\_unlocked(FILE \****stream***);** **int fileno\_unlocked(FILE \****stream***);** **int fflush\_unlocked(FILE \*\_Nullable** *stream***);**

**int fgetc\_unlocked(FILE \****stream***);** **int fputc\_unlocked(int** *c***, FILE \****stream***);**

**size\_t fread\_unlocked(**size\_t size, size\_t n;                       **void** *ptr***\[restrict** *size* **\*** *n***\],**                       **size\_t** *size***, size\_t** *n***,**                       **FILE \*restrict** *stream***);** **size\_t fwrite\_unlocked(**size\_t size, size\_t n;                       **const void** *ptr***\[restrict** *size* **\*** *n***\],**                       **size\_t** *size***, size\_t** *n***,**                       **FILE \*restrict** *stream***);**

**char \*fgets\_unlocked(**int n;                       **char** *s***\[restrict** *n***\], int** *n***, FILE \*restrict** *stream***);** **int fputs\_unlocked(const char \*restrict** *s***, FILE \*restrict** *stream***);**

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

**wint\_t getwc\_unlocked(FILE \****stream***);** **wint\_t getwchar\_unlocked(void);** **wint\_t fgetwc\_unlocked(FILE \****stream***);**

**wint\_t fputwc\_unlocked(wchar\_t** *wc***, FILE \****stream***);** **wint\_t putwc\_unlocked(wchar\_t** *wc***, FILE \****stream***);** **wint\_t putwchar\_unlocked(wchar\_t** *wc***);**

**wchar\_t \*fgetws\_unlocked(**int n;                       **wchar\_t** *ws***\[restrict** *n***\], int** *n***,**                       **FILE \*restrict** *stream***);** **int fputws\_unlocked(const wchar\_t \*restrict** *ws***,**                       **FILE \*restrict** *stream***);**

Feature Test Macro Requirements for glibc (see [**feature\_test\_macros**(7)](/feature_test_macros/7.md)):

**getc\_unlocked**(), **getchar\_unlocked**(), **putc\_unlocked**(), **putchar\_unlocked**():

```
    /* glibc >= 2.24: */ _POSIX_C_SOURCE >= 199309L
        || /* glibc <= 2.23: */ _POSIX_C_SOURCE
        || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
```

**clearerr\_unlocked**(), **feof\_unlocked**(), **ferror\_unlocked**(), **fileno\_unlocked**(), **fflush\_unlocked**(), **fgetc\_unlocked**(), **fputc\_unlocked**(), **fread\_unlocked**(), **fwrite\_unlocked**():

```
    /* glibc >= 2.19: */ _DEFAULT_SOURCE
        || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
```

**fgets\_unlocked**(), **fputs\_unlocked**(), **getwc\_unlocked**(), **getwchar\_unlocked**(), **fgetwc\_unlocked**(), **fputwc\_unlocked**(), **putwchar\_unlocked**(), **fgetws\_unlocked**(), **fputws\_unlocked**():

```
    _GNU_SOURCE
```

## DESCRIPTION

Each of these functions has the same behavior as its counterpart without the "\_unlocked" suffix, except that they do not use locking (they do not set locks themselves, and do not test for the presence of locks set by others) and hence are thread-unsafe. See [**flockfile**(3)](/flockfile/3.md).

## ATTRIBUTES

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

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **getc\_unlocked**(), **putc\_unlocked**(), **clearerr\_unlocked**(), **fflush\_unlocked**(), **fgetc\_unlocked**(), **fputc\_unlocked**(), **fread\_unlocked**(), **fwrite\_unlocked**(), **fgets\_unlocked**(), **fputs\_unlocked**(), **getwc\_unlocked**(), **fgetwc\_unlocked**(), **fputwc\_unlocked**(), **putwc\_unlocked**(), **fgetws\_unlocked**(), **fputws\_unlocked**() | Thread safety | MT-Safe race:stream |
| **getchar\_unlocked**(), **getwchar\_unlocked**() | Thread safety | MT-Unsafe race:stdin |
| **putchar\_unlocked**(), **putwchar\_unlocked**() | Thread safety | MT-Unsafe race:stdout |
| **feof\_unlocked**(), **ferror\_unlocked**(), **fileno\_unlocked**() | Thread safety | MT-Safe |

## STANDARDS

- **getc\_unlocked**() **getchar\_unlocked**() **putc\_unlocked**() **putchar\_unlocked**()

  POSIX.1-2008.

- Others:

  None.

## HISTORY

- **getc\_unlocked**() **getchar\_unlocked**() **putc\_unlocked**() **putchar\_unlocked**()

  POSIX.1-2001.

## SEE ALSO

[**flockfile**(3)](/flockfile/3.md), [**stdio**(3)](/stdio/3.md)
