summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2011-09-30 20:49:25 +0000
committerroot <root>2011-09-30 20:49:25 +0000
commit97ef1174222ff11500a22e39e5443da80f5f0de9 (patch)
treeab204275117a6abeb4c76a3798fc74e36148671a
parent8388c0410a5d86b20a2c892ee875c0230c355cb1 (diff)
*** empty log message ***
-rw-r--r--eio.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/eio.c b/eio.c
index 0a7115c..3b332fc 100644
--- a/eio.c
+++ b/eio.c
@@ -2135,15 +2135,30 @@ eio__statvfsat (int dirfd, const char *path, struct statvfs *buf)
} \
}
+static void ecb_noinline ecb_cold
+etp_proc_init (void)
+{
+#if HAVE_PRCTL_SET_NAME
+ /* provide a more sensible "thread name" */
+ char name[16 + 1];
+ const int namelen = sizeof (name) - 1;
+ int len;
+
+ prctl (PR_GET_NAME, (unsigned long)name, 0, 0, 0);
+ name [namelen] = 0;
+ len = strlen (name);
+ strcpy (name + (len < namelen - 4 ? len : namelen - 4), "/eio");
+ prctl (PR_SET_NAME, (unsigned long)name, 0, 0, 0);
+}
+#endif
+
X_THREAD_PROC (etp_proc)
{
ETP_REQ *req;
struct timespec ts;
etp_worker *self = (etp_worker *)thr_arg;
-#if HAVE_PRCTL_SET_NAME
- prctl (PR_SET_NAME, (unsigned long)"eio_thread", 0, 0, 0);
-#endif
+ etp_proc_init ();
/* try to distribute timeouts somewhat evenly */
ts.tv_nsec = ((unsigned long)self & 1023UL) * (1000000000UL / 1024UL);