--- libeio/eio.c 2011/07/24 03:32:54 1.97 +++ libeio/eio.c 2011/07/24 05:53:34 1.98 @@ -203,6 +203,14 @@ # include #endif +#if HAVE_SYS_SYSCALL_H +# include +#endif + +#if HAVE_SYS_PRCTL_H +# include +#endif + #if HAVE_SENDFILE # if __linux # include @@ -218,10 +226,6 @@ # endif #endif -#if HAVE_SYS_SYSCALL_H -# include -#endif - #ifndef D_TYPE # define D_TYPE(de) 0 #endif @@ -1915,6 +1919,10 @@ 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);