diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-14 18:10:13 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-14 19:28:34 +0100 |
| commit | 872cf03f26c2801ae6c3008ce5fa0d7856f5f85d (patch) | |
| tree | 94809812b71ee286eb5b74c70e4d08fc4c8dc057 /lib/libc/err/vwarn.c | |
| parent | ec769a83bde09c76bd6ad9ee7f391036dba5cd97 (diff) | |
libc: implement err/warn functions
Diffstat (limited to 'lib/libc/err/vwarn.c')
| -rw-r--r-- | lib/libc/err/vwarn.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/libc/err/vwarn.c b/lib/libc/err/vwarn.c new file mode 100644 index 00000000..2f485d93 --- /dev/null +++ b/lib/libc/err/vwarn.c @@ -0,0 +1,16 @@ +#include <stdarg.h> +#include <stdio.h> + +extern char *__progname; + +void vwarn(const char *fmt, va_list args) +{ + fprintf(stderr, "%s: ", __progname); + + if (fmt != NULL) { + vfprintf(stderr, fmt, args); + fprintf(stderr, ": "); + } + + perror(NULL); +} |
