9 extern int giSyscall_ClientID;
10 extern void Request_Preinit(void);
11 extern int acess__SysOpen(const char *Path, unsigned int flags);
16 fprintf(stderr, "TODO: Windows libacessnative setup\n");
23 int __attribute__ ((constructor(102))) libacessnative_init(int argc, char *argv[], char **envp);
25 const char *getenv_p(char **envp, const char *name)
27 size_t namelen = strlen(name);
30 if( strncmp(*envp, name, namelen) != 0 )
32 if( (*envp)[namelen] != '=' )
34 return (*envp)+namelen+1;
39 int libacessnative_init(int argc, char *argv[], char **envp)
43 const char *preopens = getenv_p(envp, "AN_PREOPEN");
44 printf("preopens = %s\n", preopens);
49 const char *splitter = strchr(preopens, ':');
52 len = strlen(preopens);
55 len = splitter - preopens;
58 memcpy(path, preopens, len);
60 int fd = acess__SysOpen(path, 6); // WRITE,READ,no EXEC
62 fprintf(stderr, "Unable to preopen '%s'\n", path);
67 preopens = splitter + 1;
71 // if( !getenv("ACESSNATIVE_ID")
78 void Debug(const char *format, ...)
82 va_start(args, format);
83 vfprintf(stdout, format, args);
88 void Warning(const char *format, ...)
92 va_start(args, format);
93 vfprintf(stdout, format, args);
98 void __libc_csu_fini()
102 void __libc_csu_init()