If <sys/mcontext.h> does not define __UCONTEXT_SIZE, define it as

sizeof(ucontext_t).
pull/38/head
thorpej 2024-05-18 01:21:42 +00:00
parent d8a1d80a31
commit e4214c824f
1 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ucontext.h,v 1.21 2024/05/18 01:16:21 thorpej Exp $ */
/* $NetBSD: ucontext.h,v 1.22 2024/05/18 01:21:42 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2003, 2024 The NetBSD Foundation, Inc.
@ -82,6 +82,12 @@ struct __ucontext {
#define _UC_UCONTEXT_ALIGN (~0)
#endif
#ifdef __UCONTEXT_SIZE
__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
#else
#define __UCONTEXT_SIZE sizeof(ucontext_t)
#endif
#ifndef _UC_TLSBASE
#error _UC_TLSBASE not defined.
#endif
@ -102,10 +108,6 @@ int setucontext(struct lwp *, const ucontext_t *);
void cpu_getmcontext(struct lwp *, mcontext_t *, unsigned int *);
int cpu_setmcontext(struct lwp *, const mcontext_t *, unsigned int);
int cpu_mcontext_validate(struct lwp *, const mcontext_t *);
#ifdef __UCONTEXT_SIZE
__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
#endif
#endif /* _KERNEL */
#endif /* !_SYS_UCONTEXT_H_ */