Changeset 651 for trunk/kernel/syscalls/sys_mmap.c
- Timestamp:
- Nov 14, 2019, 11:50:09 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_mmap.c
r637 r651 112 112 } 113 113 114 114 // FIXME handle Copy_On_Write for MAP_PRIVATE... 115 115 116 116 // test mmap type : can be FILE / ANON / REMOTE … … 127 127 #endif 128 128 129 129 // FIXME: handle concurent delete of file by another thread 130 130 131 131 if( fdid >= CONFIG_PROCESS_FILE_MAX_NR ) … … 164 164 #endif 165 165 166 // get inode pointer & mapper pointer 167 vfs_inode_t * inode_ptr = hal_remote_lpt(XPTR(file_cxy , &file_ptr->inode )); 166 // get mapper pointer 168 167 mapper_t * mapper_ptr = hal_remote_lpt(XPTR(file_cxy , &file_ptr->mapper)); 169 168 170 // get file size 171 uint32_t size = hal_remote_l32( XPTR( file_cxy , &inode_ptr->size ) ); 172 173 #if (DEBUG_SYS_MMAP & 1) 174 if ( DEBUG_SYS_MMAP < tm_start ) 175 printk("\n[%s] thread[%x,%x] get file size : %d bytes\n", 176 __FUNCTION__, process->pid, this->trdid, size ); 177 #endif 178 179 // chek offset and length arguments 180 if( (offset + length) > size) 181 { 182 183 #if DEBUG_SYSCALLS_ERROR 184 printk("\n[ERROR] in %s: thread[%x,%x] / offset(%d) + len(%d) >= file's size(%d)\n", 185 __FUNCTION__, process->pid, this->trdid, k_attr.offset, k_attr.length, size ); 186 #endif 187 this->errno = ERANGE; 188 return -1; 189 } 169 #if (DEBUG_SYS_MMAP & 1) 170 if ( DEBUG_SYS_MMAP < tm_start ) 171 printk("\n[%s] thread[%x,%x] get file mapper %x\n", 172 __FUNCTION__, process->pid, this->trdid, mapper_ptr ); 173 #endif 190 174 191 175 /* TODO
Note: See TracChangeset
for help on using the changeset viewer.