Lines Matching defs:dirname

159   char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
162 snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
164 return dirname;
299 static DIR *open_directory_secure(const char* dirname) {
307 RESTARTABLE(::open(dirname, O_RDONLY|O_NOFOLLOW), result);
312 warning("directory %s is a symlink and is not secure\n", dirname);
314 warning("could not open directory %s: %s\n", dirname, os::strerror(errno));
329 dirp = ::opendir(dirname);
361 static DIR *open_directory_secure_cwd(const char* dirname, int *saved_cwd_fd) {
364 DIR* dirp = open_directory_secure(dirname);
380 // Set the current directory to dirname by using the fd of the directory and
385 warning("could not change to directory %s", dirname);
628 static char* get_sharedmem_filename(const char* dirname, int vmid) {
631 size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
634 snprintf(name, nbytes, "%s/%d", dirname, vmid);
672 static void cleanup_sharedmem_resources(const char* dirname) {
676 DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd);
691 char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
742 static bool make_user_tmp_dir(const char* dirname) {
747 if (mkdir(dirname, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) == OS_ERR) {
753 if (!is_directory_secure(dirname)) {
756 warning("%s directory is insecure\n", dirname);
767 dirname, os::strerror(errno));
781 static int create_sharedmem_resources(const char* dirname, const char* filename, size_t size) {
784 if (!make_user_tmp_dir(dirname)) {
792 DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd);
933 char* dirname = get_user_tmp_dir(user_name);
934 char* filename = get_sharedmem_filename(dirname, vmid);
945 cleanup_sharedmem_resources(dirname);
950 fd = create_sharedmem_resources(dirname, short_filename, size);
953 FREE_C_HEAP_ARRAY(char, dirname);
1093 char* dirname = get_user_tmp_dir(luser);
1098 if (!is_directory_secure(dirname)) {
1099 FREE_C_HEAP_ARRAY(char, dirname);
1107 char* filename = get_sharedmem_filename(dirname, vmid);
1118 FREE_C_HEAP_ARRAY(char, dirname);