PatchworkOS
Loading...
Searching...
No Matches
vopenf.c
Go to the documentation of this file.
1#include <stdarg.h>
2#include <stdio.h>
3#include <stdlib.h>
4#include <sys/io.h>
5
6#include "common/print.h"
8
9fd_t vopenf(const char* _RESTRICT format, va_list args)
10{
11 char path[MAX_PATH];
12 vsnprintf(path, MAX_PATH, format, args);
13 return open(path);
14}
#define MAX_PATH
Maximum length of filepaths.
Definition MAX_PATH.h:11
fd_t open(const char *path)
System call for opening files.
Definition open.c:9
fd_t vopenf(const char *_RESTRICT format, va_list args)
Wrapper for opening files with a formatted path, using a va_list.
Definition vopenf.c:9
__UINT64_TYPE__ fd_t
A file descriptor.
Definition fd_t.h:12
#define _RESTRICT
Definition config.h:17
__builtin_va_list va_list
Definition stdarg.h:9
_PUBLIC int vsnprintf(char *_RESTRICT s, size_t n, const char *_RESTRICT format, va_list arg)
Definition vsnprintf.c:5