aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / native / kernel / svc / compat / stdio.h
| 1 | /* SPDX-License-Identifier: Apache-2.0 |
| 2 | * Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* Kernel-build stand-in, see README. Only "/dev/urandom" opens. */ |
| 18 | #ifndef CK_COMPAT_STDIO_H |
| 19 | #define CK_COMPAT_STDIO_H |
| 20 | #include <stddef.h> |
| 21 | typedef struct ck_compat_file FILE; |
| 22 | FILE *ck_compat_fopen(const char *path, const char *mode); |
| 23 | size_t ck_compat_fread(void *buf, size_t sz, size_t n, FILE *f); |
| 24 | int ck_compat_fclose(FILE *f); |
| 25 | #define fopen(p, m) ck_compat_fopen((p), (m)) |
| 26 | #define fread(b, s, n, f) ck_compat_fread((b), (s), (n), (f)) |
| 27 | #define fclose(f) ck_compat_fclose(f) |
| 28 | /* snprintf for the TEST-ONLY continuity wiring (svc/continuity_recovery.c): the kernel's own formatter, core/fmt.c. */ |
| 29 | #include <stdarg.h> |
| 30 | int ck_snprintf(char *buf, size_t n, const char *fmt, ...) __attribute__((format(printf, 3, 4))); |
| 31 | #define snprintf ck_snprintf |
| 32 | #endif |