Skip to content

Commit 72972e7

Browse files
committed
add __h_errno; fixes #2013
1 parent 62de2bd commit 72972e7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/library.js

+7
Original file line numberDiff line numberDiff line change
@@ -7344,6 +7344,12 @@ LibraryManager.library = {
73447344
// netdb.h
73457345
// ==========================================================================
73467346

7347+
__h_errno_state: 'allocate(1, "i32", ALLOC_STATIC)',
7348+
__h_errno_location__deps: ['__h_errno_state'],
7349+
__h_errno_location: function() {
7350+
return ___h_errno_state;
7351+
},
7352+
73477353
// We can't actually resolve hostnames in the browser, so instead
73487354
// we're generating fake IP addresses with lookup_name that we can
73497355
// resolve later on with lookup_addr.
@@ -7399,6 +7405,7 @@ LibraryManager.library = {
73997405
gethostbyaddr: function (addr, addrlen, type) {
74007406
if (type !== {{{ cDefine('AF_INET') }}}) {
74017407
___setErrNo(ERRNO_CODES.EAFNOSUPPORT);
7408+
// TODO: set h_errno
74027409
return null;
74037410
}
74047411
addr = {{{ makeGetValue('addr', '0', 'i32') }}}; // addr is in_addr

0 commit comments

Comments
 (0)