Merge branch 'master' of git://factorcode.org/git/factor
[factor/jcg.git] / vm / os-genunix.c
blobf582483ce704076cda960d80ca029114c99ce199
1 #include "master.h"
3 void c_to_factor_toplevel(CELL quot)
5 c_to_factor(quot);
8 void init_signals(void)
10 unix_init_signals();
13 void early_init(void) { }
15 #define SUFFIX ".image"
16 #define SUFFIX_LEN 6
18 const char *default_image_path(void)
20 const char *path = vm_executable_path();
22 if(!path)
23 return "factor.image";
25 /* We can't call strlen() here because with gcc 4.1.2 this
26 causes an internal compiler error. */
27 int len = 0;
28 const char *iter = path;
29 while(*iter) { len++; iter++; }
31 char *new_path = safe_malloc(PATH_MAX + SUFFIX_LEN + 1);
32 memcpy(new_path,path,len + 1);
33 memcpy(new_path + len,SUFFIX,SUFFIX_LEN + 1);
34 return new_path;