Changeset 594 for trunk/kernel/syscalls/sys_write.c
- Timestamp:
- Nov 10, 2018, 2:33:26 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_write.c
r584 r594 153 153 count ); 154 154 } 155 else if( type == INODE_TYPE_DEV ) // check ownership & write to device 156 { 157 // check user buffer size for TXT_TX 158 if( (type == INODE_TYPE_DEV) && (count >= CONFIG_TXT_KBUF_SIZE) ) 159 { 160 161 #if DEBUG_SYSCALLS_ERROR 162 printk("\n[ERROR] in %s : thread[%x,%x] user buffer size %x too large\n", 163 __FUNCTION__ , process->pid, this->trdid, count ); 164 #endif 165 this->errno = EINVAL; 166 return -1; 167 } 168 155 else if( type == INODE_TYPE_DEV ) // write to TXT device 156 { 169 157 // move count bytes to device 170 158 nbytes = devfs_user_move( false, // from buffer to device … … 175 163 else // not FILE and not DEV 176 164 { 177 nbytes = 0; 178 assert( false , "file type %d non supported\n", type ); 165 166 #if DEBUG_SYSCALLS_ERROR 167 printk("\n[ERROR] in %s : thread[%x,%x] / illegal inode type %\n", 168 __FUNCTION__, vfs_inode_type_str( type ) ); 169 #endif 170 this->errno = EBADFD; 171 return -1; 179 172 } 180 173 … … 186 179 __FUNCTION__ , process->pid, this->trdid, file_id ); 187 180 #endif 188 this->errno = error;181 this->errno = EIO; 189 182 return -1; 190 183 }
Note: See TracChangeset
for help on using the changeset viewer.