os_context_register_t *
context_eflags_addr(os_context_t *context)
{
-#if defined __linux__
+#if defined __linux__ || defined __sun
/* KLUDGE: As of kernel 2.2.14 on Red Hat 6.2, there's code in the
* <sys/ucontext.h> file to define symbolic names for offsets into
* gregs[], but it's conditional on __USE_GNU and not defined, so
return CONTEXT_ADDR_FROM_STEM(rflags);
#elif defined __OpenBSD__
return &context->sc_rflags;
+#elif defined __NetBSD__
+ return CONTEXT_ADDR_FROM_STEM(RFLAGS);
#else
#error unsupported OS
#endif