Add errno setters to platform libs. (#1576)

This commit is contained in:
Nikolay Igotti
2018-05-10 23:41:34 -07:00
committed by GitHub
parent 680f15e11b
commit f54f7bfde2
5 changed files with 37 additions and 0 deletions
@@ -23,11 +23,20 @@ static int posix_errno() {
return errno; return errno;
} }
static void set_posix_errno(int value) {
errno = value;
}
// Wrapper to access h_errno variable. // Wrapper to access h_errno variable.
static int posix_h_errno() { static int posix_h_errno() {
return h_errno; return h_errno;
} }
static void set_posix_h_errno(int value) {
h_errno = value;
}
static int init_sockets() { static int init_sockets() {
return 0; return 0;
} }
+8
View File
@@ -22,11 +22,19 @@ static int posix_errno() {
return errno; return errno;
} }
static void set_posix_errno(int value) {
errno = value;
}
// Wrapper to access h_errno variable. // Wrapper to access h_errno variable.
static int posix_h_errno() { static int posix_h_errno() {
return h_errno; return h_errno;
} }
static void set_posix_h_errno(int value) {
h_errno = value;
}
static int init_sockets() { static int init_sockets() {
return 0; return 0;
} }
@@ -43,11 +43,19 @@ static int posix_errno() {
return errno; return errno;
} }
static void set_posix_errno(int value) {
errno = value;
}
// Wrapper to access h_errno variable. // Wrapper to access h_errno variable.
static int posix_h_errno() { static int posix_h_errno() {
return h_errno; return h_errno;
} }
static void set_posix_h_errno(int value) {
h_errno = value;
}
static short posix_htons(short x) { static short posix_htons(short x) {
return htons(x); return htons(x);
} }
@@ -13,6 +13,10 @@ static int posix_errno() {
return errno; return errno;
} }
static void set_posix_errno(int value) {
errno = value;
}
static short posix_htons(short x) { static short posix_htons(short x) {
return htons(x); return htons(x);
} }
+8
View File
@@ -28,11 +28,19 @@ static int posix_errno() {
return errno; return errno;
} }
static void set_posix_errno(int value) {
errno = value;
}
// Wrapper to access h_errno variable. // Wrapper to access h_errno variable.
static int posix_h_errno() { static int posix_h_errno() {
return h_errno; return h_errno;
} }
static void set_posix_h_errno(int value) {
h_errno = value;
}
static short posix_htons(short x) { static short posix_htons(short x) {
return htons(x); return htons(x);
} }