Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 62ca560 in mainline


Ignore:
Timestamp:
2017-12-19T17:18:55Z (4 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master
Children:
7565a4b
Parents:
74a2a2d
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-19 16:25:21)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-19 17:18:55)
Message:

Add str_error() and str_error_name() to kernel, and use it to print error codes.

Location:
kernel
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r74a2a2d r62ca560  
    213213        generic/src/lib/gsort.c \
    214214        generic/src/lib/str.c \
     215        generic/src/lib/str_error.c \
    215216        generic/src/lib/elf.c \
    216217        generic/src/lib/ra.c \
  • kernel/generic/include/str.h

    r74a2a2d r62ca560  
    3939#include <stddef.h>
    4040#include <stdint.h>
     41#include <errno.h>
    4142
    4243/**< Common Unicode characters */
     
    104105extern void bin_order_suffix(const uint64_t, uint64_t *, const char **, bool);
    105106
     107extern const char *str_error(errno_t err);
     108extern const char *str_error_name(errno_t err);
     109
    106110#endif
    107111
  • kernel/generic/src/main/kinit.c

    r74a2a2d r62ca560  
    290290                        log(LF_OTHER, LVL_ERROR,
    291291                            "init[%zu]: Init binary load failed "
    292                             "(error %d, loader status %u)", i, rc,
    293                             programs[i].loader_status);
     292                            "(error %s, loader status %u)", i,
     293                            str_error_name(rc), programs[i].loader_status);
    294294        }
    295295       
  • kernel/generic/src/mm/backend_user.c

    r74a2a2d r62ca560  
    4949#include <errno.h>
    5050#include <log.h>
     51#include <str.h>
    5152
    5253static bool user_create(as_area_t *);
     
    130131                log(LF_USPACE, LVL_FATAL,
    131132                    "Page-in request for page %#" PRIxPTR
    132                     " at pager %d failed with error %d.",
    133                     upage, pager_info->pager, rc);
     133                    " at pager %d failed with error %s.",
     134                    upage, pager_info->pager, str_error_name(rc));
    134135                return AS_PF_FAULT;
    135136        }
Note: See TracChangeset for help on using the changeset viewer.