분류 전체보기683 putenv int putenv(const char *str) #include #include int putenv(const char *str) { char *p, *equal; int rval; if ((p = strdup(str)) == NULL) return (-1); if ((equal = strchr(p, '=')) == NULL) { (void)free(p); return (-1); } *equal = '\0'; rval = setenv(p, equal + 1, 1); (void)free(p); return (rval); } 2016. 7. 9. realpath char * realpath(const char *path, char resolved[PATH_MAX]) #include #include #include #include #include #include /* * char *realpath(const char *path, char resolved[PATH_MAX]); * * Find the real name of path, by removing all ".", ".." and symlink * components. Returns (resolved) on success, or (NULL) on failure, * in which case the path which caused trouble is left in (resolved). */ char * realp.. 2016. 7. 9. random long random(void) #defineTYPE_00/* linear congruential */ #defineBREAK_08 #defineDEG_00 #defineSEP_00 #defineTYPE_11/* x**7 + x**3 + 1 */ #defineBREAK_132 #defineDEG_17 #defineSEP_13 #defineTYPE_22/* x**15 + x + 1 */ #defineBREAK_264 #defineDEG_215 #defineSEP_21 #defineTYPE_33/* x**31 + x**3 + 1 */ #defineBREAK_3128 #defineDEG_331 #defineSEP_33 #defineTYPE_44/* x**63 + x + 1 */ #defineBREAK_4256.. 2016. 7. 9. setenv int setenv(const char *name, const char *value, int rewrite) #include #include char *__findenv(const char *name, int *offset); extern char **environ; /* * setenv -- *Set the value of the environmental variable "name" to be *"value". If rewrite is set, replace any current value. */ int setenv(const char *name, const char *value, int rewrite) { static char **lastenv;/* last value of environ */ cha.. 2016. 7. 9. 이전 1 ··· 149 150 151 152 153 154 155 ··· 171 다음