mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Added an `API` macro in `j6/api.h` that expands to mark the given declaration as a default-visible symbol. Also change `format` and `vformat` to non-template functions, and make calls to `main`, `exit`, and the library init functions in `_start` GOT-relative.
28 lines
480 B
C++
28 lines
480 B
C++
// The kernel depends on libj6 for some shared code,
|
|
// but should not include the user-specific code.
|
|
#ifndef __j6kernel
|
|
|
|
#include <util/format.h>
|
|
#include <j6/syscalls.h>
|
|
#include <j6/syslog.hh>
|
|
|
|
namespace j6 {
|
|
|
|
void
|
|
syslog(const char *fmt, ...)
|
|
{
|
|
char buffer[200];
|
|
|
|
va_list va;
|
|
va_start(va, fmt);
|
|
size_t n = util::vformat({buffer, sizeof(buffer) - 1}, fmt, va);
|
|
va_end(va);
|
|
|
|
buffer[n] = 0;
|
|
j6_log(buffer);
|
|
}
|
|
|
|
} // namespace j6
|
|
|
|
#endif // __j6kernel
|