Skip to content

Commit

Permalink
add __h_errno; fixes emscripten-core#2013
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Jan 16, 2014
1 parent 62de2bd commit 72972e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -7344,6 +7344,12 @@ LibraryManager.library = {
// netdb.h
// ==========================================================================

__h_errno_state: 'allocate(1, "i32", ALLOC_STATIC)',
__h_errno_location__deps: ['__h_errno_state'],
__h_errno_location: function() {
return ___h_errno_state;
},

// We can't actually resolve hostnames in the browser, so instead
// we're generating fake IP addresses with lookup_name that we can
// resolve later on with lookup_addr.
Expand Down Expand Up @@ -7399,6 +7405,7 @@ LibraryManager.library = {
gethostbyaddr: function (addr, addrlen, type) {
if (type !== {{{ cDefine('AF_INET') }}}) {
___setErrNo(ERRNO_CODES.EAFNOSUPPORT);
// TODO: set h_errno
return null;
}
addr = {{{ makeGetValue('addr', '0', 'i32') }}}; // addr is in_addr
Expand Down

0 comments on commit 72972e7

Please sign in to comment.