Page MenuHomeFreeBSD

D50687.id156543.diff
No OneTemporary

D50687.id156543.diff

diff --git a/lib/libc/gen/uexterr_gettext.c b/lib/libc/gen/uexterr_gettext.c
--- a/lib/libc/gen/uexterr_gettext.c
+++ b/lib/libc/gen/uexterr_gettext.c
@@ -8,7 +8,8 @@
* under sponsorship from the FreeBSD Foundation.
*/
-#include <sys/types.h>
+#define _WANT_P_OSREL
+#include <sys/param.h>
#include <sys/exterrvar.h>
#include <exterr.h>
#include <string.h>
@@ -18,11 +19,14 @@
.ver = UEXTERROR_VER,
};
+int __getosreldate(void);
+
static void uexterr_ctr(void) __attribute__((constructor));
static void
uexterr_ctr(void)
{
- exterrctl(EXTERRCTL_ENABLE, 0, &uexterr);
+ if (__getosreldate() >= P_OSREL_EXTERRCTL)
+ exterrctl(EXTERRCTL_ENABLE, 0, &uexterr);
}
int
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c
--- a/lib/libthr/thread/thr_create.c
+++ b/lib/libthr/thread/thr_create.c
@@ -27,6 +27,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define _WANT_P_OSREL
#include "namespace.h"
#include <sys/types.h>
#include <sys/rtprio.h>
@@ -44,6 +45,8 @@
#include "libc_private.h"
#include "thr_private.h"
+int __getosreldate(void);
+
static int create_stack(struct pthread_attr *pattr);
static void thread_start(struct pthread *curthread);
@@ -287,7 +290,8 @@
#endif
curthread->uexterr.ver = UEXTERROR_VER;
- exterrctl(EXTERRCTL_ENABLE, 0, &curthread->uexterr);
+ if (__getosreldate() >= P_OSREL_EXTERRCTL)
+ exterrctl(EXTERRCTL_ENABLE, 0, &curthread->uexterr);
/* Run the current thread's start routine with argument: */
_pthread_exit(curthread->start_routine(curthread->arg));
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -33,6 +33,7 @@
* SUCH DAMAGE.
*/
+#define _WANT_P_OSREL
#include "namespace.h"
#include <sys/param.h>
#include <sys/auxv.h>
@@ -59,6 +60,7 @@
#include "libc_private.h"
#include "thr_private.h"
+int __getosreldate(void);
char *_usrstack;
struct pthread *_thr_initial;
int _libthr_debug;
@@ -434,7 +436,8 @@
#endif
thread->uexterr.ver = UEXTERROR_VER;
- exterrctl(EXTERRCTL_ENABLE, EXTERRCTLF_FORCE, &thread->uexterr);
+ if (__getosreldate() >= P_OSREL_EXTERRCTL)
+ exterrctl(EXTERRCTL_ENABLE, EXTERRCTLF_FORCE, &thread->uexterr);
/* Others cleared to zero by thr_alloc() */
}
diff --git a/sys/sys/param.h b/sys/sys/param.h
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -107,6 +107,7 @@
#define P_OSREL_TIDPID 1400079
#define P_OSREL_ARM64_SPSR 1400084
#define P_OSREL_TLSBASE 1500044
+#define P_OSREL_EXTERRCTL 1500045
#define P_OSREL_MAJOR(x) ((x) / 100000)
#endif

File Metadata

Mime Type
text/plain
Expires
Sun, Feb 8, 5:05 PM (4 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28476095
Default Alt Text
D50687.id156543.diff (2 KB)

Event Timeline