diff options
Diffstat (limited to 'usr/src/lib/libc/inc')
-rw-r--r-- | usr/src/lib/libc/inc/libc.h | 13 | ||||
-rw-r--r-- | usr/src/lib/libc/inc/mtlib.h | 15 | ||||
-rw-r--r-- | usr/src/lib/libc/inc/stdiom.h | 4 | ||||
-rw-r--r-- | usr/src/lib/libc/inc/synonyms.h | 5 | ||||
-rw-r--r-- | usr/src/lib/libc/inc/thr_uberdata.h | 38 |
5 files changed, 49 insertions, 26 deletions
diff --git a/usr/src/lib/libc/inc/libc.h b/usr/src/lib/libc/inc/libc.h index e3570f7d7d..11aec9371c 100644 --- a/usr/src/lib/libc/inc/libc.h +++ b/usr/src/lib/libc/inc/libc.h @@ -20,7 +20,7 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -238,7 +238,14 @@ extern int64_t _portfs(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t, /* * defined in xpg4.c */ -extern int __xpg4; +extern int __xpg4; /* global */ +extern int libc__xpg4; /* copy of __xpg4, private to libc */ + +/* + * defined in xpg6.c + */ +extern uint_t __xpg6; /* global */ +extern uint_t libc__xpg6; /* copy of __xpg6, private to libc */ /* * i18n prototypes - strong symbols (weak symbols are in libintl.h) @@ -343,7 +350,7 @@ extern int _doscan(FILE *, const char *, va_list); extern int _wcscoll(const wchar_t *, const wchar_t *); extern size_t _wcsxfrm(wchar_t *, const wchar_t *, size_t); extern wint_t _fputwc(wint_t, FILE *); -extern pid_t waitpid_cancel(pid_t, int *, int); + #ifdef __cplusplus } #endif diff --git a/usr/src/lib/libc/inc/mtlib.h b/usr/src/lib/libc/inc/mtlib.h index 5d3fbf1451..c6dbdb1f3a 100644 --- a/usr/src/lib/libc/inc/mtlib.h +++ b/usr/src/lib/libc/inc/mtlib.h @@ -20,7 +20,7 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -42,9 +42,6 @@ extern int _private_mutex_destroy(mutex_t *); extern int _private_mutex_lock(mutex_t *); extern int _private_mutex_trylock(mutex_t *); extern int _private_mutex_unlock(mutex_t *); -#define rmutex_lock _private_mutex_lock -#define rmutex_trylock _private_mutex_trylock -#define rmutex_unlock _private_mutex_unlock extern void lmutex_lock(mutex_t *); extern void lmutex_unlock(mutex_t *); extern int __rwlock_init(rwlock_t *, int, void *); @@ -62,6 +59,10 @@ extern void sig_mutex_unlock(mutex_t *); extern int sig_mutex_trylock(mutex_t *); extern int sig_cond_wait(cond_t *, mutex_t *); extern int sig_cond_reltimedwait(cond_t *, mutex_t *, const timespec_t *); +extern void cancel_safe_mutex_lock(mutex_t *); +extern void cancel_safe_mutex_unlock(mutex_t *); +extern int cancel_safe_mutex_trylock(mutex_t *); +extern int cancel_active(void); /* the private libc thread-safe allocator */ extern void *lmalloc(size_t); @@ -81,9 +82,9 @@ extern int __mutex_unlock(mutex_t *); extern int _cond_init(cond_t *, int, void *); extern int _cond_destroy(cond_t *); -extern int _cond_wait(cond_t *, mutex_t *); -extern int _cond_timedwait(cond_t *, mutex_t *, const timespec_t *); -extern int _cond_reltimedwait(cond_t *, mutex_t *, const timespec_t *); +extern int __cond_wait(cond_t *, mutex_t *); +extern int __cond_timedwait(cond_t *, mutex_t *, const timespec_t *); +extern int __cond_reltimedwait(cond_t *, mutex_t *, const timespec_t *); extern int _cond_signal(cond_t *); extern int _cond_broadcast(cond_t *); diff --git a/usr/src/lib/libc/inc/stdiom.h b/usr/src/lib/libc/inc/stdiom.h index 108ee6c529..9befb8a3c6 100644 --- a/usr/src/lib/libc/inc/stdiom.h +++ b/usr/src/lib/libc/inc/stdiom.h @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -100,7 +100,7 @@ typedef unsigned char Uchar; -#define _flockrel(rl) rmutex_unlock(rl) +#define _flockrel(rl) cancel_safe_mutex_unlock(rl) #define MAXVAL (MAXINT - (MAXINT % BUFSIZ)) diff --git a/usr/src/lib/libc/inc/synonyms.h b/usr/src/lib/libc/inc/synonyms.h index e7e69a3ce7..ca8e25a41a 100644 --- a/usr/src/lib/libc/inc/synonyms.h +++ b/usr/src/lib/libc/inc/synonyms.h @@ -20,7 +20,7 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -860,6 +860,7 @@ extern "C" { #define regfree _regfree #define remque _remque #define renameat _renameat +#define rename _rename #define resetmnttab _resetmnttab #define resolvepath _resolvepath #define rmdir _rmdir @@ -942,7 +943,6 @@ extern "C" { #define s_fcntl _s_fcntl #define sfconvert _sfconvert #define sgconvert _sgconvert -#define _sharefs __sharefs #define shmat _shmat #define shmctl64 _shmctl64 #define shmctl _shmctl @@ -1146,6 +1146,7 @@ extern "C" { #define vwarn _vwarn #define vwarnx _vwarnx #define wait3 _wait3 +#define wait4 _wait4 #define waitid _waitid #define waitpid _waitpid #define wait _wait diff --git a/usr/src/lib/libc/inc/thr_uberdata.h b/usr/src/lib/libc/inc/thr_uberdata.h index c8ef313e16..e14714bec6 100644 --- a/usr/src/lib/libc/inc/thr_uberdata.h +++ b/usr/src/lib/libc/inc/thr_uberdata.h @@ -20,7 +20,7 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -508,7 +508,8 @@ typedef struct ulwp { char ul_cond_wait_defer; /* thread_cond_wait_defer */ char ul_error_detection; /* thread_error_detection */ char ul_async_safe; /* thread_async_safe */ - char ul_pad1[2]; + char ul_pad1; + char ul_save_state; /* bind_guard() interface to ld.so.1 */ int ul_adaptive_spin; /* thread_adaptive_spin */ int ul_queue_spin; /* thread_queue_spin */ volatile int ul_critical; /* non-zero == in a critical region */ @@ -529,7 +530,7 @@ typedef struct ulwp { uberflags_t *volatile ul_schedctl_called; /* ul_schedctl is set up */ volatile sc_shared_t *volatile ul_schedctl; /* schedctl data */ int ul_bindflags; /* bind_guard() interface to ld.so.1 */ - int ul_pad2; + uint_t ul_libc_locks; /* count of cancel_safe_mutex_lock()s */ tsd_t *ul_stsd; /* slow TLS for keys >= TSD_NFAST */ void *ul_ftsd[TSD_NFAST]; /* fast TLS for keys < TSD_NFAST */ td_evbuf_t ul_td_evbuf; /* event buffer */ @@ -905,7 +906,8 @@ typedef struct ulwp32 { char ul_cond_wait_defer; /* thread_cond_wait_defer */ char ul_error_detection; /* thread_error_detection */ char ul_async_safe; /* thread_async_safe */ - char ul_pad1[2]; + char ul_pad1; + char ul_save_state; /* bind_guard() interface to ld.so.1 */ int ul_adaptive_spin; /* thread_adaptive_spin */ int ul_queue_spin; /* thread_queue_spin */ int ul_critical; /* non-zero == in a critical region */ @@ -926,7 +928,7 @@ typedef struct ulwp32 { caddr32_t ul_schedctl_called; /* ul_schedctl is set up */ caddr32_t ul_schedctl; /* schedctl data */ int ul_bindflags; /* bind_guard() interface to ld.so.1 */ - int ul_pad2; + uint_t ul_libc_locks; /* count of cancel_safe_mutex_lock()s */ caddr32_t ul_stsd; /* slow TLS for keys >= TSD_NFAST */ caddr32_t ul_ftsd[TSD_NFAST]; /* fast TLS for keys < TSD_NFAST */ td_evbuf32_t ul_td_evbuf; /* event buffer */ @@ -1203,7 +1205,10 @@ extern void block_all_signals(ulwp_t *self); (ASSERT((self)->ul_critical + (self)->ul_sigdefer != 0), 0) : \ __lwp_sigmask(SIG_SETMASK, &(self)->ul_sigmask, NULL))) +extern void set_cancel_pending_flag(ulwp_t *, int); +extern void set_cancel_eintr_flag(ulwp_t *); extern void set_parking_flag(ulwp_t *, int); +extern int cancel_active(void); extern void *_thr_setup(ulwp_t *); extern void _fpinherit(ulwp_t *); @@ -1219,6 +1224,9 @@ extern void sig_mutex_unlock(mutex_t *); extern int sig_mutex_trylock(mutex_t *); extern int sig_cond_wait(cond_t *, mutex_t *); extern int sig_cond_reltimedwait(cond_t *, mutex_t *, const timespec_t *); +extern void cancel_safe_mutex_lock(mutex_t *); +extern void cancel_safe_mutex_unlock(mutex_t *); +extern int cancel_safe_mutex_trylock(mutex_t *); extern void _prefork_handler(void); extern void _postfork_parent_handler(void); extern void _postfork_child_handler(void); @@ -1253,10 +1261,10 @@ extern pid_t __forkallx(int); extern pid_t _private_getpid(void); extern uid_t _private_geteuid(void); extern int _kill(pid_t, int); -extern int _open(const char *, int, ...); -extern int _close(int); -extern ssize_t _read(int, void *, size_t); -extern ssize_t _write(int, const void *, size_t); +extern int _private_open(const char *, int, ...); +extern int _private_close(int); +extern ssize_t __read(int, void *, size_t); +extern ssize_t __write(int, const void *, size_t); extern void *_memcpy(void *, const void *, size_t); extern void *_memset(void *, int, size_t); extern int _memcmp(const void *, const void *, size_t); @@ -1303,6 +1311,7 @@ extern void _siglongjmp(sigjmp_buf, int); extern int _pthread_setspecific(pthread_key_t, const void *); extern void *_pthread_getspecific(pthread_key_t); extern void _pthread_exit(void *); +extern int _pthread_setcancelstate(int, int *); extern void _private_testcancel(void); /* belongs in <pthread.h> */ @@ -1333,14 +1342,19 @@ extern int __mutex_unlock(mutex_t *); extern int mutex_is_held(mutex_t *); extern int _cond_init(cond_t *, int, void *); -extern int _cond_wait(cond_t *, mutex_t *); -extern int _cond_timedwait(cond_t *, mutex_t *, const timespec_t *); -extern int _cond_reltimedwait(cond_t *, mutex_t *, const timespec_t *); extern int _cond_signal(cond_t *); extern int _cond_broadcast(cond_t *); extern int _cond_destroy(cond_t *); extern int cond_signal_internal(cond_t *); extern int cond_broadcast_internal(cond_t *); +/* cancellation points: */ +extern int _cond_wait(cond_t *, mutex_t *); +extern int _cond_timedwait(cond_t *, mutex_t *, const timespec_t *); +extern int _cond_reltimedwait(cond_t *, mutex_t *, const timespec_t *); +/* not cancellation points: */ +extern int __cond_wait(cond_t *, mutex_t *); +extern int __cond_timedwait(cond_t *, mutex_t *, const timespec_t *); +extern int __cond_reltimedwait(cond_t *, mutex_t *, const timespec_t *); extern int __rwlock_init(rwlock_t *, int, void *); extern int rw_read_is_held(rwlock_t *); |