<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you for looking into it. I am as perplexed as you.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Happy New Year!</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jeff</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Rob Landley <rob@landley.net><br>
<b>Sent:</b> Friday, December 21, 2018 9:26 PM<br>
<b>To:</b> J Martin; toybox@lists.landley.net<br>
<b>Subject:</b> Re: [Toybox] toybox host command</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 12/20/18 5:11 PM, J Martin wrote:<br>
> Hello,<br>
> I was wondering if the host command is functional?<br>
<br>
It's in pending, so it's not fully reviewed and cleaned up, but it seems to work<br>
when I tried it?<br>
<br>
$ ./host landley.net<br>
landley.net has address 208.113.171.142<br>
<br>
<br>
> I have had no success in<br>
> getting it to run on Windows 10 under Mobaxterm 11.<br>
> <br>
> It just returns with no output.<br>
<br>
Window Subsystem for Linux is basically an inverted version of Wine:<br>
<br>
<a href="https://en.wikipedia.org/wiki/Wine_(software">https://en.wikipedia.org/wiki/Wine_(software</a>)<br>
<br>
As with QEMU's application emulation, it intercepts and translates system calls,<br>
and doesn't necessarily implement all of them.<br>
<br>
(Or are you using cygwin? Or mingw? Or midipix?)<br>
<br>
> /etc/resolv.conf is valid and has correct info.<br>
> Thanks for any input!<br>
> Jeff<br>
<br>
Toybox isn't reading /etc/resolv.conf, it's #including <resolv.h> and having<br>
libc do stuff for it.<br>
<br>
> this is from strace:<br>
> <snip><br>
> 49 132541 [main] toybox 12836 fcntl64: 0 = fcntl(3, 2, 0x1)<br>
> 67 132608 [main] toybox 12836 fhandler_socket::bind: 0 =<br>
> setsockopt(SO_EXCLUSIVEADDRUSE), Win32 error 0<br>
> 143 132751 [main] toybox 12836 cygwin_bind: 0 = bind(3, 0x64BF4C, 16)<br>
<br>
You're using cygwin.<br>
<br>
I don't have a windows machine. I've never written a windows program. (I went<br>
from a Atari 800 to C64 to Amiga to Dos to Desqview to OS/2 to Linux, wih<br>
divergences into Solaris and AIX and a little bit of ancient MacOS, 6 months on<br>
JavaOS, a couple horrible mainframe things, bare metal embedded things...)<br>
<br>
I'm mostly familiar with Cygwin because EMX had a similar translation layer for<br>
OS/2 (and years later I worked with somebody at TimeSys who maintained a chunk<br>
of a cygwin fork), but lemme see if I can figure anything out here...<br>
<br>
> 52 132803 [main] toybox 12836 getpid: 12836 = getpid()<br>
> 72 132875 [main] toybox 12836 __set_errno: void __set_winsock_errno(const<br>
> char*, int):224 setting errno 11<br>
> 51 132926 [main] toybox 12836 __set_winsock_errno: recv_internal:1613 -<br>
> winsock error 10035 -> errno 11<br>
> 52 132978 [main] toybox 12836 cygwin_recvfrom: -1 = recvfrom(3, 0x64C6C0,<br>
> 512, 0x0, 0x0, 0x0), errno 11<br>
<br>
Hmmm... 11 is EAGAIN, which is just weird. (Is errno-base.h stable across<br>
architectures?)<br>
<br>
> 294 133272 [main] toybox 12836 cygwin_sendto: 27 = sendto(3, 0x64C5A8, 27,<br>
> 0x0, 0x612A4F00, 16)<br>
> 55 133327 [main] toybox 12836 pselect: pselect (4, 0x64BF3C, 0x0, 0x0,<br>
> 0x64BED8, 0x0)<br>
> 51 133378 [main] toybox 12836 pselect: to->tv_sec 5, to->tv_nsec 0, us 5000000<br>
> 92 133470 [main] toybox 12836 dtable::select_read: fd 3<br>
> 45 133515 [main] toybox 12836 select: sel.always_ready 0<br>
> 172 133687 [main] toybox 12836 start_thread_socket: stuff_start 0x64BCC4<br>
> --- Process 12836 thread 9800 created<br>
> --- Process 12836, exception 406d1388 at 76A34172<br>
<br>
Toybox isn't threaded, I have no _clue_ what's going on here.<br>
<br>
> 2102 135789 [socksel] toybox 12836 cygthread::stub: thread 'socksel', id<br>
> 0x2648, stack_ptr 0x4FFCD60<br>
> 56 135845 [socksel] toybox 12836 thread_socket: stuff_start 0x64BCC4,<br>
> timeout 4294967295<br>
> 56 135901 [main] toybox 12836 select_stuff::wait: m 4, us 5000000,<br>
> wmfo_timeout -1<br>
> 93 135994 [socksel] toybox 12836 peek_socket: read_ready: 1, write_ready: 0,<br>
> except_ready: 0<br>
> 51 136045 [socksel] toybox 12836 thread_socket: leaving thread_socket<br>
> 99 136144 [main] toybox 12836 select_stuff::wait: wait_ret 2, m = 4. verifying<br>
> 52 136196 [main] toybox 12836 select_stuff::wait: res after verify 0<br>
> 89 136285 [main] toybox 12836 select_stuff::wait: returning 0<br>
<br>
select_stuff?<br>
<br>
> 45 136330 [main] toybox 12836 select: sel.wait returns 0<br>
> 54 136384 [main] toybox 12836 peek_socket: read_ready: 1, write_ready: 0,<br>
> except_ready: 0<br>
> 53 136437 [main] toybox 12836 set_bits: me 0x20061AE0, testing fd 3 ()<br>
> 52 136489 [main] toybox 12836 set_bits: ready 1<br>
> 88 136577 [main] toybox 12836 select_stuff::cleanup: calling cleanup routines<br>
> 44 136621 [main] toybox 12836 socket_cleanup: si 0x20061B10 si->thread<br>
> 0x611CE950<br>
> 181 136802 [main] toybox 12836 socket_cleanup: returning<br>
> 48 136850 [main] toybox 12836 select_stuff::destroy: deleting select records<br>
> 90 136940 [main] toybox 12836 select_stuff::cleanup: calling cleanup routines<br>
> 46 136986 [main] toybox 12836 select_stuff::destroy: deleting select records<br>
> 47 137033 [main] toybox 12836 pselect: 1 = select (4, 0x64BF3C, 0x0, 0x0,<br>
> 0x64BED8)<br>
> 111 137144 [main] toybox 12836 cygwin_recvfrom: 27 = recvfrom(3, 0x64C6C0,<br>
> 512, 0x0, 0x64BF5C, 0x64BF38)<br>
> 401 137545 [main] toybox 12836 fhandler_pty_slave::write: pty0,<br>
> write(0x432E3C, 4)<br>
> 49 137594 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1902): pty output_mutex (0x1CC): waiting -1 ms<br>
> 51 137645 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1902): pty output_mutex: acquired<br>
> 53 137698 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1941): pty output_mutex(0x1CC) released<br>
<br>
Locking for a pseudo-terminal handler? How is a PTY involved here?<br>
<br>
> host 55 137753 [main] toybox 12836 write: 4 = write(2, 0x432E3C, 4)<br>
> 111 137864 [main] toybox 12836 fhandler_pty_slave::write: pty0,<br>
> write(0x43260F, 2)<br>
> 74 137938 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1902): pty output_mutex (0x1CC): waiting -1 ms<br>
> 46 137984 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1902): pty output_mutex: acquired<br>
> 69 138053 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1941): pty output_mutex(0x1CC) released<br>
> : 49 138102 [main] toybox 12836 write: 2 = write(2, 0x43260F, 2)<br>
> 218 138320 [main] toybox 12836 fhandler_pty_slave::write: pty0,<br>
> write(0x4342DE, 15)<br>
> 42 138362 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1902): pty output_mutex (0x1CC): waiting -1 ms<br>
> 49 138411 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1902): pty output_mutex: acquired<br>
> 52 138463 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1941): pty output_mutex(0x1CC) released<br>
> Host not found. 45 138508 [main] toybox 12836 write: 15 = write(2, 0x4342DE, 15)<br>
> 307 138815 [main] toybox 12836 fhandler_pty_slave::write: pty0,<br>
> write(0x611CBDF7, 1)<br>
> 45 138860 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1902): pty output_mutex (0x1CC): waiting -1 ms<br>
> 48 138908 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1902): pty output_mutex: acquired<br>
> 54 138962 [main] toybox 12836 fhandler_pty_common::process_opost_output:<br>
> (1941): pty output_mutex(0x1CC) released<br>
> <br>
> 47 139009 [main] toybox 12836 write: 1 = write(2, 0x611CBDF7, 1)<br>
> 1041 140050 [main] toybox 12836 do_exit: do_exit (256), exit_state 1<br>
<br>
What just exited?<br>
<br>
> 46 140096 [main] toybox 12836 void: 0x0 = signal (20, 0x1)<br>
> 51 140147 [main] toybox 12836 void: 0x0 = signal (1, 0x1)<br>
> 47 140194 [main] toybox 12836 void: 0x0 = signal (2, 0x1)<br>
> 46 140240 [main] toybox 12836 void: 0x0 = signal (3, 0x1)<br>
<br>
It's setting signal handlers?<br>
<br>
$ strace ./host landley.net 2>&1 | grep signal<br>
$<br>
<br>
Nothing...<br>
<br>
Sorry, I have no idea what's going on here. I kind of doubt toybox is<br>
responsible for any of this.<br>
<br>
Rob<br>
</div>
</span></font></div>
</body>
</html>