Revision ce798cf2 vl.c

b/vl.c
59 59
#ifdef __linux__
60 60
#include <pty.h>
61 61
#include <malloc.h>
62
#include <sys/prctl.h>
63 62

  
64 63
#include <linux/ppdev.h>
65 64
#include <linux/parport.h>
......
284 283
}
285 284

  
286 285
/***********************************************************/
287

  
288
static void set_proc_name(const char *s)
289
{
290
#if defined(__linux__) && defined(PR_SET_NAME)
291
    char name[16];
292
    if (!s)
293
        return;
294
    name[sizeof(name) - 1] = 0;
295
    strncpy(name, s, sizeof(name));
296
    /* Could rewrite argv[0] too, but that's a bit more complicated.
297
       This simple way is enough for `top'. */
298
    prctl(PR_SET_NAME, name);
299
#endif    	
300
}
301
 
302
/***********************************************************/
303 286
/* real time host monotonic timer */
304 287

  
305 288
/* compute with 96 bit intermediate result: (a*b)/c */
......
2988 2971
			    exit(1);
2989 2972
			}
2990 2973
			p += 8;
2991
			set_proc_name(p);
2974
			os_set_proc_name(p);
2992 2975
		     }	
2993 2976
		 }	
2994 2977
                break;

Also available in: Unified diff