+2015-09-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #18970]
+ * misc/error.c (error): Replace pthread_setcancelstate with
+ __pthread_setcancelstate.
+ (error_at_line): Likewise.
+ * posix/wordexp.c (parse_comm): Likewise.
+ * stdlib/fmtmsg.c (fmtmsg): Likewise.
+ * nptl/forward.c (pthread_setcancelstate): Renamed to ...
+ (__pthread_setcancelstate): This.
+ (pthread_setcancelstate): Add an alias.
+ * nptl/nptl-init.c (pthread_functions): Replace
+ ptr_pthread_setcancelstate with ptr___pthread_setcancelstate.
+ * sysdeps/nptl/pthread-functions.h (pthread_functions): Likewise.
+ * nptl/pthreadP.h (__pthread_setcancelstate): Mark it with
+ hidden_proto.
+ * nptl/pthread_setcancelstate.c (__pthread_setcancelstate): Mark
+ it with hidden_def.
+ * sysdeps/nptl/libc-lockP.h (__pthread_setcancelstate): New.
+ (pthread_setcancelstate): Renamed to ...
+ (__pthread_setcancelstate): This.
+ * sysdeps/unix/sysv/linux/fatal-prepare.h (FATAL_PREPARE): Use
+ __libc_ptf_call with __pthread_setcancelstate.
+
2015-09-17 Joseph Myers <joseph@codesourcery.com>
Andreas Schwab <schwab@suse.de>
18421, 18480, 18525, 18595, 18610, 18618, 18647, 18661, 18674, 18675,
18681, 18757, 18778, 18781, 18787, 18789, 18790, 18795, 18796, 18820,
18823, 18824, 18857, 18863, 18870, 18872, 18873, 18875, 18887, 18921,
- 18951, 18952, 18961, 18966, 18967, 18977.
+ 18951, 18952, 18961, 18966, 18967, 18970, 18977
* The obsolete header <regexp.h> has been removed. Programs that require
this header must be updated to use <regex.h> instead.
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
- 0);
+ __libc_ptf_call (__pthread_setcancelstate,
+ (PTHREAD_CANCEL_DISABLE, &state), 0);
#endif
flush_stdout ();
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+ __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
+ __libc_ptf_call (__pthread_setcancelstate,
+ (PTHREAD_CANCEL_DISABLE, &state),
0);
#endif
#ifdef _LIBC
_IO_funlockfile (stderr);
# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+ __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
# endif
#endif
}
FORWARD2 (pthread_self, pthread_t, (void), (), return 0)
-FORWARD (pthread_setcancelstate, (int state, int *oldstate), (state, oldstate),
- 0)
+FORWARD (__pthread_setcancelstate, (int state, int *oldstate),
+ (state, oldstate), 0)
+strong_alias (__pthread_setcancelstate, pthread_setcancelstate)
FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0)
.ptr_pthread_mutex_lock = __pthread_mutex_lock,
.ptr_pthread_mutex_unlock = __pthread_mutex_unlock,
.ptr_pthread_self = __pthread_self,
- .ptr_pthread_setcancelstate = __pthread_setcancelstate,
+ .ptr___pthread_setcancelstate = __pthread_setcancelstate,
.ptr_pthread_setcanceltype = __pthread_setcanceltype,
.ptr___pthread_cleanup_upto = __pthread_cleanup_upto,
.ptr___pthread_once = __pthread_once,
hidden_proto (__pthread_getspecific)
hidden_proto (__pthread_setspecific)
hidden_proto (__pthread_once)
+hidden_proto (__pthread_setcancelstate)
#endif
extern int __pthread_cond_broadcast_2_0 (pthread_cond_2_0_t *cond);
return 0;
}
strong_alias (__pthread_setcancelstate, pthread_setcancelstate)
+hidden_def (__pthread_setcancelstate)
// XXX Ideally we do want the thread being cancelable.
// XXX If demand is there we'll change it.
int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate,
+ __libc_ptf_call (__pthread_setcancelstate,
(PTHREAD_CANCEL_DISABLE, &state), 0);
#endif
flags, pwordexp, ifs, ifs_white);
#ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+ __libc_ptf_call (__pthread_setcancelstate,
+ (state, NULL), 0);
#endif
free (comm);
/* We do not want this call to be cut short by a thread
cancellation. Therefore disable cancellation for now. */
int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
- 0);
+ __libc_ptf_call (__pthread_setcancelstate,
+ (PTHREAD_CANCEL_DISABLE, &state), 0);
#endif
__libc_lock_lock (lock);
__libc_lock_unlock (lock);
#ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+ __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0);
#endif
return result;
void (*__parent) (void),
void (*__child) (void));
+extern int __pthread_setcancelstate (int state, int *oldstate);
/* Make the pthread functions weak so that we can elide them from
weak_extern (__pthread_once)
weak_extern (__pthread_initialize)
weak_extern (__pthread_atfork)
+weak_extern (__pthread_setcancelstate)
weak_extern (_pthread_cleanup_push_defer)
weak_extern (_pthread_cleanup_pop_restore)
-weak_extern (pthread_setcancelstate)
# else
# pragma weak __pthread_mutex_init
# pragma weak __pthread_mutex_destroy
# pragma weak __pthread_once
# pragma weak __pthread_initialize
# pragma weak __pthread_atfork
+# pragma weak __pthread_setcancelstate
# pragma weak _pthread_cleanup_push_defer
# pragma weak _pthread_cleanup_pop_restore
-# pragma weak pthread_setcancelstate
# endif
#endif
int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
pthread_t (*ptr_pthread_self) (void);
- int (*ptr_pthread_setcancelstate) (int, int *);
+ int (*ptr___pthread_setcancelstate) (int, int *);
int (*ptr_pthread_setcanceltype) (int, int *);
void (*ptr___pthread_cleanup_upto) (__jmp_buf, char *);
int (*ptr___pthread_once) (pthread_once_t *, void (*) (void));
/* We have to completely disable cancellation. assert() must not be a
cancellation point but the implementation uses write() etc. */
-#ifdef SHARED
-# include <pthread-functions.h>
-# define FATAL_PREPARE \
- { \
- if (__libc_pthread_functions_init) \
- PTHFCT_CALL (ptr_pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, \
- NULL)); \
- }
-#else
-# pragma weak pthread_setcancelstate
-# define FATAL_PREPARE \
- { \
- if (pthread_setcancelstate != NULL) \
- pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL); \
- }
-#endif
+#define FATAL_PREPARE \
+ __libc_ptf_call (__pthread_setcancelstate, \
+ (PTHREAD_CANCEL_DISABLE, NULL), 0)