libk  posix.h at [a8d93823f1]

File arch/posix.h artifact 7d3483dee1 part of check-in a8d93823f1


/* arch/posix.h - posix constants
 *  ? this file defines posix magic numbers
 *    needed in syscalls, both cross-platform
 *    ones and os-dependent ones. note that
 *    the values may change depending on the
 *    OS specified! */

#include <k/def.h>
#include <k/type.h>

enum posix_prot {
	posix_prot_none  = 0,
	posix_prot_read  = 1 << 0,
	posix_prot_write = 1 << 1,
	posix_prot_exec  = 1 << 2
};

enum posix_map {
	posix_map_shared  = 1,
	posix_map_private = 2
};

enum posix_flag {
	posix_flag_fixed     = 0x10,
#if KVos == KA_os_lin
	posix_flag_anonymous = 0x20,
#elif KVos == KA_os_fbsd
	posix_flag_anonymous = 0x1000,
#endif

	/* platform flags */
	posix_flag_linux_hugetlb = 0x40000
};

struct kposix_syscall_result { long ret, error; }

kposix_syscall(enum kposix_syscall syscall, sz argct, long args[]);