Lines Matching refs:dirname

157   char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
160 snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
162 return dirname;
433 static char* get_sharedmem_filename(const char* dirname, int vmid) {
436 size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
439 snprintf(name, nbytes, "%s/%d", dirname, vmid);
473 static void remove_file(const char* dirname, const char* filename) {
475 size_t nbytes = strlen(dirname) + strlen(filename) + 2;
478 strcpy(path, dirname);
497 static void cleanup_sharedmem_resources(const char* dirname) {
500 DIR* dirp = os::opendir(dirname);
507 if (!is_directory_secure(dirname)) {
521 char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
532 remove_file(dirname, entry->d_name);
555 remove_file(dirname, entry->d_name);
568 static bool make_user_tmp_dir(const char* dirname) {
573 if (mkdir(dirname, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) == OS_ERR) {
579 if (!is_directory_secure(dirname)) {
582 warning("%s directory is insecure\n", dirname);
593 dirname, strerror(errno));
607 static int create_sharedmem_resources(const char* dirname, const char* filename, size_t size) {
610 if (!make_user_tmp_dir(dirname)) {
716 char* dirname = get_user_tmp_dir(user_name);
717 char* filename = get_sharedmem_filename(dirname, vmid);
720 cleanup_sharedmem_resources(dirname);
725 fd = create_sharedmem_resources(dirname, filename, size);
728 FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
870 char* dirname = get_user_tmp_dir(luser);
875 if (!is_directory_secure(dirname)) {
876 FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
881 char* filename = get_sharedmem_filename(dirname, vmid);
892 FREE_C_HEAP_ARRAY(char, dirname, mtInternal);