Changeset b9dd49a
- Timestamp:
- 03/12/10 13:26:57 (11 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 441f34d
- Parents:
- 66649b4
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/ior-thread.c
r22a9ccc rb9dd49a 34 34 35 35 #include "wandio.h" 36 #include "config.h" 36 37 #include <sys/types.h> 37 38 #include <sys/stat.h> … … 42 43 #include <stdbool.h> 43 44 #include <errno.h> 45 #ifdef HAVE_SYS_PRCTL_H 46 #include <sys/prctl.h> 47 #endif 44 48 45 49 /* Libtrace IO module implementing a threaded reader. … … 97 101 int buffer=0; 98 102 bool running = true; 103 char namebuf[17]; 104 105 #ifdef PR_SET_NAME 106 if (prctl(PR_GET_NAME, namebuf, 0,0,0) == 0) { 107 namebuf[16] = '\0'; /* Make sure it's NUL terminated */ 108 /* If the filename is too long, overwrite the last few bytes */ 109 if (strlen(namebuf)>9) { 110 strcpy(namebuf+10,"[ior]"); 111 } 112 else { 113 strncat(namebuf," [ior]",16); 114 } 115 prctl(PR_SET_NAME, namebuf, 0,0,0); 116 } 117 #endif 99 118 100 119 pthread_mutex_lock(&DATA(state)->mutex); -
lib/iow-thread.c
r22a9ccc rb9dd49a 33 33 34 34 #include "wandio.h" 35 #include "config.h" 35 36 #include <sys/types.h> 36 37 #include <sys/stat.h> … … 40 41 #include <string.h> 41 42 #include <stdbool.h> 43 #ifdef HAVE_SYS_PRCTL_H 44 #include <sys/prctl.h> 45 #endif 42 46 43 47 /* Libtrace IO module implementing a threaded writer. … … 95 99 int buffer=0; 96 100 bool running = true; 101 char namebuf[17]; 97 102 iow_t *state = (iow_t *) userdata; 103 104 #ifdef PR_SET_NAME 105 if (prctl(PR_GET_NAME, namebuf, 0,0,0) == 0) { 106 namebuf[16] = '\0'; /* Make sure it's NUL terminated */ 107 /* If the filename is too long, overwrite the last few bytes */ 108 if (strlen(namebuf)>9) { 109 strcpy(namebuf+10,"[iow]"); 110 } 111 else { 112 strncat(namebuf," [iow]",16); 113 } 114 prctl(PR_SET_NAME, namebuf, 0,0,0); 115 } 116 #endif 98 117 99 118 pthread_mutex_lock(&DATA(state)->mutex);
Note: See TracChangeset
for help on using the changeset viewer.