chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] posix-extras: allow to set process title displayed b


From: Andy Bennett
Subject: Re: [Chicken-users] posix-extras: allow to set process title displayed by ps(1)
Date: Mon, 13 Oct 2014 19:59:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.8.1

Hi,

Alex has worked on a version that keeps track of the original argv[0]
length:

-----
(define (set-proc-title str)
  (print "setting proc title to " str)
  (receive (c v) (argc+argv)
           ((foreign-lambda* void ((c-string str) (c-pointer argv))
                             "static int orig_len = -1;
                              char *name = ((char**) argv)[0];
                              if (orig_len == -1) orig_len = strlen(name);
                              strncpy(name,str,orig_len);
                             ")
                             str v)))
-----




Regards,
@ndy

-- 
address@hidden
http://www.ashurst.eu.org/
0x7EBA75FF




reply via email to

[Prev in Thread] Current Thread [Next in Thread]