From 97ef1174222ff11500a22e39e5443da80f5f0de9 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 30 Sep 2011 20:49:25 +0000 Subject: *** empty log message *** --- eio.c | 21 ++++++++++++++++++--- 1 file 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); -- cgit v1.2.3