summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/stderr.c
blob: 155f0e3e3ca53804bdc686c456d37ae4032b3d02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "__stdio.h"   // for __FILE
#include "stdatomic.h" // for ATOMIC_FLAG_INIT

#include <fcntl.h>  // for O_WRONLY
#include <unistd.h> // for STDERR_FILENO

#define BUFSIZ 4096

struct __FILE __stderr = { .fd = STDERR_FILENO,
			   .flags = O_WRONLY,
			   .type = 0,
			   .buf = 0,
			   .buf_len = 0,
			   .buf_size = 0,
			   .buf_pos = 0,
			   .eof = 0,
			   .unget_cnt = 0,
			   .next = 0,
			   .offset = 0,
			   .lock = ATOMIC_FLAG_INIT };

struct FILE *const stderr = (struct FILE *)&__stderr;