Artifact 5796abefa542097f162a95f5cb92be2863afe3f6c4013a5c14d5a36231ad8ae1:
- File kcore/testbin.exe.c — part of check-in [6479e060a3] at 2019-07-26 09:51:02 on branch trunk — major update. fix ridiculous old type size determination mechanism. mmap is still broken and i'm not sure why; the syscall does not appear to be going through correctly - see posix_mmap, kmheapa, and kcore/testbin.exe.fn (user: lexi, size: 515) [annotate] [blame] [check-ins using]
#include <k/core.h> #include <k/mem.h> #include <k/io.h> #include <k/magic.h> struct object { u8 a; s16 b; bool c; }; kbad entry(kenv e) { const char msg[] = "hello from libk\n"; ksraw ptr = { Kmsz(msg), msg }; bool maybe = true; maybe = no; if (kiosend(e.std, ptr, null) == kiocond_ok) { /* great, continue */ } else { return kbad_io; } struct object* block = kmheapa(sizeof (struct object) * 4); if (block == null) return kbad_mem; else return kbad_ok; block[1].a = 5; return kbad_ok; }