设置一些环境变量信息
/* * set_pglocale_pgservice * * Set application-specific locale and service directory * * This function takes the value of argv[0] rather than a full path. * * (You may be wondering why this is in exec.c. It requires this module's * services and doesn't introduce any new dependencIEs,so this seems as * good as anyplace.) */voIDset_pglocale_pgservice(const char *argv0,const char *app){ char path[MAXPGPATH]; char my_exec_path[MAXPGPATH]; char env_path[MAXPGPATH + sizeof("PGSYSconfdIR=")]; /* longer than * PGLOCALEDIR */ /* don't set LC_ALL in the backend */ if (strcmp(app,PG_TEXTDOMAIN("postgres")) != 0) setlocale(LC_ALL,""); if (find_my_exec(argv0,my_exec_path) < 0) return;#ifdef ENABLE_NLS get_locale_path(my_exec_path,path); bindtextdomain(app,path); textdomain(app); if (getenv("PGLOCALEDIR") == NulL) { /* set for libpq to use */ snprintf(env_path,sizeof(env_path),"PGLOCALEDIR=%s",path); canonicalize_path(env_path + 12); putenv(strdup(env_path)); }#endif if (getenv("PGSYSconfdIR") == NulL) { get_etc_path(my_exec_path,path); /* set for libpq to use */ snprintf(env_path,"PGSYSconfdIR=%s",path); canonicalize_path(env_path + 13); putenv(strdup(env_path)); }}附加信息: (1)环境变量 http://linux.chinaitlab.com/manual/database/PostgreSQL80zhref/source/libpq-envars.html 总结
以上是内存溢出为你收集整理的postgres 之 initdb 源码分析 二全部内容,希望文章能够帮你解决postgres 之 initdb 源码分析 二所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)