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

-- 
[email protected]
http://www.ashurst.eu.org/
0x7EBA75FF


_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to