summaryrefslogtreecommitdiff
path: root/eio.c
diff options
context:
space:
mode:
authorroot <root>2011-07-24 05:53:34 +0000
committerroot <root>2011-07-24 05:53:34 +0000
commitf5975d60cfe2e7d1b6c259f5ad800a823ee682c3 (patch)
treef2a4b2445d10952a74a0905dee513524303a6163 /eio.c
parent95c2bf9fb4cfcbceebac121d5a5a0d702af25cef (diff)
*** empty log message ***
Diffstat (limited to 'eio.c')
-rw-r--r--eio.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/eio.c b/eio.c
index 04985e1..30c7f75 100644
--- a/eio.c
+++ b/eio.c
@@ -203,6 +203,14 @@ static void eio_destroy (eio_req *req);
# include <utime.h>
#endif
+#if HAVE_SYS_SYSCALL_H
+# include <sys/syscall.h>
+#endif
+
+#if HAVE_SYS_PRCTL_H
+# include <sys/prctl.h>
+#endif
+
#if HAVE_SENDFILE
# if __linux
# include <sys/sendfile.h>
@@ -218,10 +226,6 @@ static void eio_destroy (eio_req *req);
# endif
#endif
-#if HAVE_SYS_SYSCALL_H
-# include <sys/syscall.h>
-#endif
-
#ifndef D_TYPE
# define D_TYPE(de) 0
#endif
@@ -1915,6 +1919,10 @@ X_THREAD_PROC (etp_proc)
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
+
/* try to distribute timeouts somewhat evenly */
ts.tv_nsec = ((unsigned long)self & 1023UL) * (1000000000UL / 1024UL);