Changes in kernel/generic/src/console/console.c [e3a050c7:297cb73] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/console.c
re3a050c7 r297cb73 52 52 #include <errno.h> 53 53 #include <str.h> 54 #include <abi/klog.h> 54 55 55 56 #define KLOG_PAGES 8 … … 335 336 * 336 337 */ 337 sysarg_t sys_klog(int fd, const void *buf, size_t size)338 sysarg_t sys_klog(int cmd, const void *buf, size_t size) 338 339 { 339 340 char *data; 340 341 int rc; 341 342 343 switch (cmd) { 344 case KLOG_UPDATE: 345 klog_update(NULL); 346 return EOK; 347 case KLOG_WRITE: 348 case KLOG_COMMAND: 349 break; 350 default: 351 return ENOTSUP; 352 } 353 342 354 if (size > PAGE_SIZE) 343 355 return (sysarg_t) ELIMIT; … … 355 367 data[size] = 0; 356 368 357 printf("%s", data); 369 switch (cmd) { 370 case KLOG_WRITE: 371 printf("%s", data); 372 break; 373 case KLOG_COMMAND: 374 for (unsigned int i = 0; i < size; i++) 375 indev_push_character(stdin, data[i]); 376 indev_push_character(stdin, '\n'); 377 break; 378 } 379 358 380 free(data); 359 } else 360 klog_update(NULL); 361 381 } 382 362 383 return size; 363 384 }
Note:
See TracChangeset
for help on using the changeset viewer.