]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
- report the size requested size in pthread_attr_setstacksize() when
authorJulian Seward <jseward@acm.org>
Tue, 4 Jun 2002 20:59:16 +0000 (20:59 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 4 Jun 2002 20:59:16 +0000 (20:59 +0000)
   the size is bigger then the hardcoded value in valgrind.  This
   makes it easier to find out which value to use for
   VG_PTHREAD_STACK_SIZE.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@378

coregrind/arch/x86-linux/vg_libpthread.c
coregrind/vg_libpthread.c
vg_libpthread.c

index 3ed46c033e5c64cf96043b131044f93f2de2f688..c2b0f68e619ec9fdf8888422e0dcfdb74cada214 100644 (file)
@@ -249,14 +249,17 @@ int pthread_attr_setstacksize (pthread_attr_t *__attr,
                                size_t __stacksize)
 {
    size_t limit;
+   char buf[1024];
    ensure_valgrind("pthread_attr_setstacksize");
    limit = VG_PTHREAD_STACK_SIZE - VG_AR_CLIENT_STACKBASE_REDZONE_SZB 
                                  - 1000; /* paranoia */
    if (__stacksize < limit)
       return 0;
-   barf("pthread_attr_setstacksize: "
-        "requested size >= VG_PTHREAD_STACK_SIZE\n   "
-        "edit vg_include.h and rebuild.");
+   snprintf(buf, sizeof(buf), "pthread_attr_setstacksize: "
+            "requested size %d >= VG_PTHREAD_STACK_SIZE\n   "
+            "edit vg_include.h and rebuild.", __stacksize);
+   buf[sizeof(buf)-1] = '\0'; /* Make sure it is zero terminated */
+   barf(buf);
 }
 
 
index 3ed46c033e5c64cf96043b131044f93f2de2f688..c2b0f68e619ec9fdf8888422e0dcfdb74cada214 100644 (file)
@@ -249,14 +249,17 @@ int pthread_attr_setstacksize (pthread_attr_t *__attr,
                                size_t __stacksize)
 {
    size_t limit;
+   char buf[1024];
    ensure_valgrind("pthread_attr_setstacksize");
    limit = VG_PTHREAD_STACK_SIZE - VG_AR_CLIENT_STACKBASE_REDZONE_SZB 
                                  - 1000; /* paranoia */
    if (__stacksize < limit)
       return 0;
-   barf("pthread_attr_setstacksize: "
-        "requested size >= VG_PTHREAD_STACK_SIZE\n   "
-        "edit vg_include.h and rebuild.");
+   snprintf(buf, sizeof(buf), "pthread_attr_setstacksize: "
+            "requested size %d >= VG_PTHREAD_STACK_SIZE\n   "
+            "edit vg_include.h and rebuild.", __stacksize);
+   buf[sizeof(buf)-1] = '\0'; /* Make sure it is zero terminated */
+   barf(buf);
 }
 
 
index 3ed46c033e5c64cf96043b131044f93f2de2f688..c2b0f68e619ec9fdf8888422e0dcfdb74cada214 100644 (file)
@@ -249,14 +249,17 @@ int pthread_attr_setstacksize (pthread_attr_t *__attr,
                                size_t __stacksize)
 {
    size_t limit;
+   char buf[1024];
    ensure_valgrind("pthread_attr_setstacksize");
    limit = VG_PTHREAD_STACK_SIZE - VG_AR_CLIENT_STACKBASE_REDZONE_SZB 
                                  - 1000; /* paranoia */
    if (__stacksize < limit)
       return 0;
-   barf("pthread_attr_setstacksize: "
-        "requested size >= VG_PTHREAD_STACK_SIZE\n   "
-        "edit vg_include.h and rebuild.");
+   snprintf(buf, sizeof(buf), "pthread_attr_setstacksize: "
+            "requested size %d >= VG_PTHREAD_STACK_SIZE\n   "
+            "edit vg_include.h and rebuild.", __stacksize);
+   buf[sizeof(buf)-1] = '\0'; /* Make sure it is zero terminated */
+   barf(buf);
 }