Files
mop3/ce/mprintf.c
kamkow1 7bcd40151d
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m13s
Move e_pid and e_pgid to libprocess, Add get_self_pid () syscall
2026-03-17 22:13:01 +01:00

28 lines
503 B
C

#include "mprintf.h"
#include <malloc.h>
#include <printf.h>
#include <process_self.h>
#include <stdarg.h>
#include <string.h>
#include <system.h>
void mprintf (const char* fmt, ...) {
va_list args;
va_start (args, fmt);
char* buf = malloc (MPRINTF_BUF_MAX);
if (buf == NULL) {
va_end (args);
return;
}
memset (buf, 0, MPRINTF_BUF_MAX);
int len = vsnprintf (buf, MPRINTF_BUF_MAX, fmt, args);
va_end (args);
mail_send (process_get_exec_pgid (), buf, len);
free (buf);
}