32 const char *g_FilesToPreload[] = {
41 "/support/gcc/libexec/gcc/x86_64-pedigree/4.8.2/cc1",
42 "/support/gcc/libexec/gcc/x86_64-pedigree/4.8.2/cc1plus",
43 "/support/gcc/libexec/gcc/x86_64-pedigree/4.8.2/collect2",
46 "/libraries/libpthread.so",
47 "/libraries/libpedigree-c.so",
48 "/libraries/libpedigree.so",
49 "/libraries/libui.so",
50 "/libraries/libgmp.so",
51 "/libraries/libmpfr.so",
52 "/libraries/libmpc.so",
55 #define BLOCK_READ_SIZE 0x100000 57 int main(
int argc,
char **argv)
62 klog(LOG_INFO,
"preloadd: forked, daemon is pid %d...", f);
66 klog(LOG_INFO,
"preloadd: daemon starting...");
69 const char *s = g_FilesToPreload[n++];
70 char *buf = (
char *) malloc(BLOCK_READ_SIZE);
77 klog(LOG_INFO,
"preloadd: preloading %s...", s);
78 FILE *fp = fopen(s,
"rb");
79 for (off_t off = 0; off < st.st_size; off += BLOCK_READ_SIZE)
80 fread(buf, BLOCK_READ_SIZE, 1, fp);
82 klog(LOG_INFO,
"preloadd: preloading %s complete!", s);
86 klog(LOG_INFO,
"preloadd: %s probably does not exist", s);
88 s = g_FilesToPreload[n++];