/*
 * offsets5845.c -- kernel structure offsets needed by the DF-5845 ring0
 * stub, harvested on the guest against the running kernel source.
 */
#define _KERNEL_STRUCTURES
#include <sys/types.h>
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/ucred.h>
#include <stddef.h>
#include <stdio.h>

int main(void) {
	printf("off_pucred %zu\n", offsetof(struct proc, p_ucred));
	printf("off_p_pid %zu\n", offsetof(struct proc, p_pid));
	printf("off_cr_uid %zu\n", offsetof(struct ucred, cr_uid));
	printf("off_cr_ruid %zu\n", offsetof(struct ucred, cr_ruid));
	printf("off_cr_svuid %zu\n", offsetof(struct ucred, cr_svuid));
	printf("off_cr_ngroups %zu\n", offsetof(struct ucred, cr_ngroups));
	printf("off_cr_groups %zu\n", offsetof(struct ucred, cr_groups));
	printf("sizeof_ucred %zu\n", sizeof(struct ucred));
	return 0;
}
