libk  Artifact [8406c82300]

Artifact 8406c8230029c1d228803ca2e3db84c13e45c887a71ef20561a2bf1639d85126:


#include <k/core.h>
#include <k/mem.h>
#include <k/io.h>
#include <k/magic.h>

struct object {
	u8 a;
	s16 b;
	bool c;
};

stat_long 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;
	
	block[1].a = 5;

	if (kmheapf(block) != kmcond_ok) return kbad_mem;

	return kbad_ok;
}