From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61549 invoked by alias); 18 Jan 2016 16:13:09 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 61534 invoked by uid 89); 18 Jan 2016 16:13:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-93.4 required=5.0 tests=AWL,BAYES_05,KAM_LAZY_DOMAIN_SECURITY,KHOP_DYNAMIC,RCVD_IN_BRBL_LASTEXT,RCVD_IN_PBL,RDNS_DYNAMIC,USER_IN_WHITELIST autolearn=no version=3.3.2 spammy=Glen, H*MI:sk:1645435, H*f:sk:1645435, H*i:sk:1645435 X-HELO: calimero.vinschen.de Received: from ipbcc05c50.dynamic.kabel-deutschland.de (HELO calimero.vinschen.de) (188.192.92.80) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Jan 2016 16:13:07 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id F04C4A805C0; Mon, 18 Jan 2016 17:13:04 +0100 (CET) Date: Mon, 18 Jan 2016 18:10:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Need tips to open a socket and to debug it Message-ID: <20160118161304.GB21254@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <956984971.4908269.1452966941574.JavaMail.yahoo.ref@mail.yahoo.com> <956984971.4908269.1452966941574.JavaMail.yahoo@mail.yahoo.com> <1645435954.1234364.1452968175143.JavaMail.yahoo@mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline In-Reply-To: <1645435954.1234364.1452968175143.JavaMail.yahoo@mail.yahoo.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2016-01/txt/msg00209.txt.bz2 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2423 On Jan 16 18:16, Glen L wrote: >=20 > Greetings all, >=20 > I'm moving a "C" program to 64-bit Windows 10 that worked previously > in 32-bit Win7. It builds, compiles and runs (AFAIK) with the > exception of being able to open a socket. Calling the socket thusly: >=20 > if ((g->listen =3D socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) { > fprintf(stderr, "Can't create socket: %d %s", (int) errno, strerr= or(errno)); > return -1; > } >=20 > The code is built for 64-bit windows using this: > x86_64-pc-cygwin-gcc -g --std=3Dgnu99 -O0 -DGLUT_DISABLE_ATEXIT_HACK -nos= tdinc -march=3Dcore2 -m64 >=20 >=20 > The result, however, is ENOENT and "No such file or directory." > uname -a : CYGWIN_NT-10.0 LAPTOP-B8KN061R 2.4.0(0.293/5/3) 2016-01-15 16:= 16 x86_64 Cygwin >=20 > I've tried a few things with the firewall and looked for internet > tips. No luck, clearly. There's no firewall involved if a simple socket call goes wrong. For AF_LOCAL Cygwin opens an AF_INET socket, but which is unbound until you call bind or connect. I tried this myself and it works for me: $ uname -srvm CYGWIN_NT-10.0 2.4.0(0.293/5/3) 2016-01-15 16:16 x86_64 $ cat < sock.c #include /* See NOTES */ #include #include #include #include int main() { int fd =3D socket (AF_LOCAL, SOCK_STREAM, 0); if (fd < 0) { fprintf (stderr, "Can't create socket: %d %s", errno, strerror (errno)); return -1; } printf ("Success\n"); return 0; } EOF $ gcc -g -o sock sock.c $ ./sock Success > So, I had the idea to step into the socket call and see what's going > on. ENOENT seems a bit weird. I'm using Eclipse and gdb for this and > it's working fine, with source, for the application. I can step around > the machine code for the cygwin calls but no source. I've tried > downloading the source files and debug info but I'm perplexed as to > making that work. I don't seem to be finding the source files by hand > that look like the machine code. You don't need to install the source package. When you installed the cygwin-debuginfo file, the debug files are installed into /usr/lib/debug/ and the sources under /usr/src/debug/cygwin-2.4.0-1/ Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --Kj7319i9nmIyA2yE Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWnQ8QAAoJEPU2Bp2uRE+g3hAP/2eXAtdkR+SsznZQCKfoNBIL dTW4kO7zTKUl3KsTwDjoTDBzxx+A0ketjHCYeFGliLX4K8uk4XObY6rGErjLYp5r q0NIHIizqkK19A+/teBPjnxId6VKBvN6hGKiz8sMX/CI5Oc3dFC4px+F1SS7cR6Y sgxrdSrFYeNXUiUUH3xvA1lqT00aipAzew3hY01EmKF5SIJGWopcHaQubAMHiT8N FEJ7bZfTqd1OBULHIUR8npftqBsmD7SjPbG62kG8z2yRF3NSfuemv9/mV8okOBdX 6xcdmh6I6QtfciXCdfKdO4nRcTwD/lsFqyWBpqB+URXRMF6o9JajM5DfIdluJKqn pOcqrKDSkJrMyBk7cl+jNa1DM9JZOXCjZFRVstZgxP9gj8/t95Dct9jZCiWQOCx7 VFtC46+Z3+uByYt88aFjwiaZaY3vFsD86AZy04ATiE0zb0vOk/AWWlAffo+/MNvr vOvP7JPIvA2Bt5b2WRBaYfBaueOC8vpBJAyfdLa6Yv1xu2Es4lt7MrWWY53nFG4m eHkMjf6pjEQ6HoTNiEpVedYMuRgbEPsoXjrFWY+ji3gXxL4W0HrHts9O1GNPfYwt lQHNaWzKCgAbA2L8hq6I53qzTZm3fn9ohlhgNeZBbrU63Wxdw+k5vN6JtUMjO9mc L5gNUwwPuDXF9BHE3Ok+ =bOu7 -----END PGP SIGNATURE----- --Kj7319i9nmIyA2yE--