thr_rtld.c (5670b8cc3672d5a6bc2c41eb48d7d01343c43ad0) | thr_rtld.c (1235d276b78a769bded01d51c9bf3cdc480db9fb) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2006, David Xu <davidxu@freebsd.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 25 unchanged lines hidden (view full) --- 34#include <link.h> 35#include <stdlib.h> 36#include <string.h> 37 38#include "libc_private.h" 39#include "rtld_lock.h" 40#include "thr_private.h" 41 | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2006, David Xu <davidxu@freebsd.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 25 unchanged lines hidden (view full) --- 34#include <link.h> 35#include <stdlib.h> 36#include <string.h> 37 38#include "libc_private.h" 39#include "rtld_lock.h" 40#include "thr_private.h" 41 |
42#undef errno 43extern int errno; | 42extern int __libsys_errno; |
44 45static int _thr_rtld_clr_flag(int); 46static void *_thr_rtld_lock_create(void); 47static void _thr_rtld_lock_destroy(void *); 48static void _thr_rtld_lock_release(void *); 49static void _thr_rtld_rlock_acquire(void *); 50static int _thr_rtld_set_flag(int); 51static void _thr_rtld_wlock_acquire(void *); --- 39 unchanged lines hidden (view full) --- 91 ((char *)lock)[i] = 0; 92 busy_places &= ~(1 << locki); 93} 94 95#define SAVE_ERRNO() { \ 96 if (curthread != _thr_initial) \ 97 errsave = curthread->error; \ 98 else \ | 43 44static int _thr_rtld_clr_flag(int); 45static void *_thr_rtld_lock_create(void); 46static void _thr_rtld_lock_destroy(void *); 47static void _thr_rtld_lock_release(void *); 48static void _thr_rtld_rlock_acquire(void *); 49static int _thr_rtld_set_flag(int); 50static void _thr_rtld_wlock_acquire(void *); --- 39 unchanged lines hidden (view full) --- 90 ((char *)lock)[i] = 0; 91 busy_places &= ~(1 << locki); 92} 93 94#define SAVE_ERRNO() { \ 95 if (curthread != _thr_initial) \ 96 errsave = curthread->error; \ 97 else \ |
99 errsave = errno; \ | 98 errsave = __libsys_errno; \ |
100} 101 102#define RESTORE_ERRNO() { \ 103 if (curthread != _thr_initial) \ 104 curthread->error = errsave; \ 105 else \ | 99} 100 101#define RESTORE_ERRNO() { \ 102 if (curthread != _thr_initial) \ 103 curthread->error = errsave; \ 104 else \ |
106 errno = errsave; \ | 105 __libsys_errno = errsave; \ |
107} 108 109static void 110_thr_rtld_rlock_acquire(void *lock) 111{ 112 struct pthread *curthread; 113 struct rtld_lock *l; 114 int errsave; --- 172 unchanged lines hidden --- | 106} 107 108static void 109_thr_rtld_rlock_acquire(void *lock) 110{ 111 struct pthread *curthread; 112 struct rtld_lock *l; 113 int errsave; --- 172 unchanged lines hidden --- |