Changeset 670 for trunk/kernel/syscalls/sys_opendir.c
- Timestamp:
- Nov 19, 2020, 11:45:52 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_opendir.c
r637 r670 2 2 * sys_opendir.c - Open an user accessible VFS directory. 3 3 * 4 * Author Alain Greiner (2016,2017,2018,2019 )4 * Author Alain Greiner (2016,2017,2018,2019,2020) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 54 54 process_t * process = this->process; // client process 55 55 56 #if (DEBUG_SYS_OPENDIR || CONFIG_INSTRUMENTATION_SYSCALLS)56 #if DEBUG_SYS_OPENDIR || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS 57 57 uint64_t tm_start = hal_get_cycles(); 58 58 #endif … … 65 65 66 66 #if DEBUG_SYSCALLS_ERROR 67 printk("\n[ERROR] in %s / thread[%x,%x] : DIR buffer %x unmapped\n", 67 if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 68 printk("\n[ERROR] in %s : thread[%x,%x] / DIR buffer %x unmapped\n", 68 69 __FUNCTION__ , process->pid , this->trdid, dirp ); 69 70 #endif … … 72 73 } 73 74 75 // check pathname in user space 76 error = vmm_get_vseg( process , (intptr_t)pathname, &vseg ); 77 78 if( error ) 79 { 80 81 #if DEBUG_SYSCALLS_ERROR 82 if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 83 printk("\n[ERROR] in %s : thread[%x,%x] / pathname %x unmapped\n", 84 __FUNCTION__ , process->pid , this->trdid, pathname ); 85 #endif 86 this->errno = EINVAL; 87 return -1; 88 } 74 89 // check pathname length 75 90 if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH ) … … 77 92 78 93 #if DEBUG_SYSCALLS_ERROR 94 if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 79 95 printk("\n[ERROR] in %s / thread[%x,%x] : pathname too long\n", 80 96 __FUNCTION__ , process->pid , this->trdid ); … … 90 106 91 107 #if DEBUG_SYS_OPENDIR 92 if( DEBUG_SYS_OPENDIR < tm_start )108 if( DEBUG_SYS_OPENDIR < (uint32_t)tm_start ) 93 109 printk("\n[%s] thread[%x,%x] enter for directory <%s> / cycle %d\n", 94 110 __FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_start ); … … 122 138 123 139 #if DEBUG_SYSCALLS_ERROR 124 printk("\n[ERROR] in %s / thread[%x,%x] : cannot found directory <%s>\n", 140 if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 141 printk("\n[ERROR] in %s : thread[%x,%x] / cannot found directory <%s>\n", 125 142 __FUNCTION__ , process->pid , this->trdid , kbuf ); 126 143 #endif … … 134 151 inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) ); 135 152 136 if( inode_type != INODE_TYPE_DIR ) 137 { 138 139 #if DEBUG_SYSCALLS_ERROR 140 printk("\n[ERROR] in %s / thread[%x,%x] : cannot found directory <%s>\n", 153 if( inode_type != FILE_TYPE_DIR ) 154 { 155 156 #if DEBUG_SYSCALLS_ERROR 157 if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 158 printk("\n[ERROR] in %s : thread[%x,%x] / <%s> is not a directory\n", 141 159 __FUNCTION__ , process->pid , this->trdid , kbuf ); 142 160 #endif … … 165 183 166 184 #if DEBUG_SYSCALLS_ERROR 167 printk("\n[ERROR] in %s / thread[%x,%x] : cannot create user_dir for <%s>\n", 185 if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 186 printk("\n[ERROR] in %s : thread[%x,%x] / cannot create user_dir for <%s>\n", 168 187 __FUNCTION__ , process->pid , this->trdid , kbuf ); 169 188 #endif
Note: See TracChangeset
for help on using the changeset viewer.