summaryrefslogtreecommitdiffstats
path: root/lib/libkse
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-03-29 22:43:43 +0000
committermarkm <markm@FreeBSD.org>2002-03-29 22:43:43 +0000
commit76fe441a7bf75d73962641b785f158b5cc9dc7f8 (patch)
tree4e267e060bfb6d96f46ab0d79c49b277402c0dd0 /lib/libkse
parent6085f75ded37ec415ded7d6373ecd09bcb088ac4 (diff)
downloadFreeBSD-src-76fe441a7bf75d73962641b785f158b5cc9dc7f8.zip
FreeBSD-src-76fe441a7bf75d73962641b785f158b5cc9dc7f8.tar.gz
Do not use __progname directly (except in [gs]etprogname(3)).
Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland.
Diffstat (limited to 'lib/libkse')
-rw-r--r--lib/libkse/thread/thr_spinlock.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libkse/thread/thr_spinlock.c b/lib/libkse/thread/thr_spinlock.c
index 696174e..7333709 100644
--- a/lib/libkse/thread/thr_spinlock.c
+++ b/lib/libkse/thread/thr_spinlock.c
@@ -33,14 +33,16 @@
*
*/
+#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <sched.h>
-#include <unistd.h>
#include <pthread.h>
-#include <string.h>
-#include "pthread_private.h"
+#include <unistd.h>
+
+#include <libc_private.h>
-extern char *__progname;
+#include "pthread_private.h"
/*
* Lock a location for the running thread. Yield to allow other
@@ -91,7 +93,7 @@ _spinlock_debug(spinlock_t *lck, char *fname, int lineno)
cnt++;
if (cnt > 100) {
char str[256];
- snprintf(str, sizeof(str), "%s - Warning: Thread %p attempted to lock %p from %s (%d) was left locked from %s (%d)\n", __progname, curthread, lck, fname, lineno, lck->fname, lck->lineno);
+ snprintf(str, sizeof(str), "%s - Warning: Thread %p attempted to lock %p from %s (%d) was left locked from %s (%d)\n", _getprogname(), curthread, lck, fname, lineno, lck->fname, lck->lineno);
__sys_write(2,str,strlen(str));
__sleep(1);
cnt = 0;
OpenPOWER on IntegriCloud