Changeset 305 for trunk/kernel/syscalls/sys_rmdir.c
- Timestamp:
- Jul 31, 2017, 2:46:50 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_rmdir.c
r23 r305 35 35 { 36 36 error_t error; 37 paddr_t paddr;38 uint32_t length;39 37 char kbuf[CONFIG_VFS_MAX_PATH_LENGTH]; 40 38 … … 42 40 process_t * process = this->process; 43 41 44 // check pathname in userspace45 error = vmm_v2p_translate( false , pathname , &paddr);42 // get pathname copy in kernel space 43 error = hal_strcpy_from_uspace( kbuf , pathname , CONFIG_VFS_MAX_PATH_LENGTH ); 46 44 47 if( error ) 48 { 49 printk("\n[ERROR] in %s : user buffer unmapped for thread %x in process %x\n", 50 __FUNCTION__ , this->trdid , process->pid ); 51 this->errno = EINVAL; 52 return -1; 53 } 54 55 // get pathname length 56 length = hal_strlen_from_uspace( pathname ); 57 58 if( length >= CONFIG_VFS_MAX_PATH_LENGTH ) 45 if( error ) 59 46 { 60 47 printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ ); … … 62 49 return -1; 63 50 } 64 65 // get pathname copy in kernel space66 hal_copy_from_uspace( kbuf, pathname, length );67 51 68 52 // get cluster and local pointer on reference process
Note: See TracChangeset
for help on using the changeset viewer.