summaryrefslogtreecommitdiff
path: root/lib/libc/include/libc.h
blob: 87d4e88fc42de0cb76cedab1c9bc579d21b3c28c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef __LIBC_LIBC_H
#define __LIBC_LIBC_H

#include <stddef.h>
#include <stdatomic.h>

#define weak_reference(old, new) extern __typeof(old)((new)) __attribute__((__weak__, __alias__(#old)))

struct libc {
	size_t auxv[32];

	enum {
		LIBC_ENVP_TOUCHED = 1 << 0,
	} flags;

	struct {
		volatile atomic_flag abort;
		volatile atomic_flag malloc;
		volatile atomic_flag environ;
	} lock;
};

extern struct libc __libc;

#endif