summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-25 20:49:14 -0400
committermidipix <writeonce@midipix.org>2016-11-11 00:22:51 -0500
commitf2737f6303b86bcdde64648bb08f0bd434f878cf (patch)
tree33e065a6f23c670340fdfb63f960ea106ff77e8c
parent5f2fd613307fca4aad473a45363b8703624b756c (diff)
downloadmdso-f2737f6303b86bcdde64648bb08f0bd434f878cf.tar.bz2
mdso-f2737f6303b86bcdde64648bb08f0bd434f878cf.tar.xz
mdso.h: enum mdso_custom_error(): definition and integration
-rw-r--r--include/mdso/mdso.h10
-rw-r--r--src/logic/mdso_map_input.c3
2 files changed, 12 insertions, 1 deletions
diff --git a/include/mdso/mdso.h b/include/mdso/mdso.h
index 1cceb7b..d8c5057 100644
--- a/include/mdso/mdso.h
+++ b/include/mdso/mdso.h
@@ -44,6 +44,16 @@ extern "C" {
#define MDSO_ERROR_CHILD 0x0004
#define MDSO_ERROR_CUSTOM 0x0008
+enum mdso_custom_error {
+ MDSO_ERR_FLOW_ERROR,
+ MDSO_ERR_FLEE_ERROR,
+ MDSO_ERR_NULL_CONTEXT,
+ MDSO_ERR_NULL_SOURCE,
+ MDSO_ERR_INVALID_CONTEXT,
+ MDSO_ERR_INVALID_SOURCE,
+ MDSO_ERR_SOURCE_SIZE_ZERO,
+ MDSO_ERR_CAP,
+};
struct mdso_source_version {
int major;
diff --git a/src/logic/mdso_map_input.c b/src/logic/mdso_map_input.c
index 592aaae..9dbdaff 100644
--- a/src/logic/mdso_map_input.c
+++ b/src/logic/mdso_map_input.c
@@ -42,7 +42,8 @@ int mdso_map_input(
return MDSO_SYSTEM_ERROR(dctx);
else if (st.st_size == 0)
- return MDSO_CUSTOM_ERROR(dctx,0);
+ return MDSO_CUSTOM_ERROR(
+ dctx,MDSO_ERR_SOURCE_SIZE_ZERO);
map->size = st.st_size;
map->addr = mmap(0,map->size,prot,MAP_PRIVATE,fd,0);