From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: ilove zfs Newsgroups: gmane.lisp.guile.bugs Subject: bug#25790: SOCK_CLOEXEC and SOCK_NONBLOCK undeclared identifier errors with 2.1.7 Date: Sun, 19 Feb 2017 08:18:53 +0000 (GMT) Message-ID: <750c3b96-c1fb-40cb-b208-0dc2a205d283@me.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="Boundary_(ID_wmrFKLr9sVXgFLllcEwyww)" X-Trace: blaine.gmane.org 1487493196 10473 195.159.176.226 (19 Feb 2017 08:33:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2017 08:33:16 +0000 (UTC) To: 25790@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Feb 19 09:33:11 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfMvc-00025M-91 for guile-bugs@m.gmane.org; Sun, 19 Feb 2017 09:33:08 +0100 Original-Received: from localhost ([::1]:32902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfMvh-0004su-TM for guile-bugs@m.gmane.org; Sun, 19 Feb 2017 03:33:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfMvb-0004sn-5M for bug-guile@gnu.org; Sun, 19 Feb 2017 03:33:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfMvX-0004Es-5G for bug-guile@gnu.org; Sun, 19 Feb 2017 03:33:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfMvX-0004Eg-20 for bug-guile@gnu.org; Sun, 19 Feb 2017 03:33:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cfMvW-0000KZ-M5 for bug-guile@gnu.org; Sun, 19 Feb 2017 03:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: ilove zfs Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 19 Feb 2017 08:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25790 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14874931391212 (code B ref -1); Sun, 19 Feb 2017 08:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Feb 2017 08:32:19 +0000 Original-Received: from localhost ([127.0.0.1]:45558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfMuo-0000JU-R7 for submit@debbugs.gnu.org; Sun, 19 Feb 2017 03:32:19 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfMiX-0008Or-Sb for submit@debbugs.gnu.org; Sun, 19 Feb 2017 03:19:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfMiR-0007AF-28 for submit@debbugs.gnu.org; Sun, 19 Feb 2017 03:19:32 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37653) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cfMiQ-0007A5-UW for submit@debbugs.gnu.org; Sun, 19 Feb 2017 03:19:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfMiO-0002iq-SL for bug-guile@gnu.org; Sun, 19 Feb 2017 03:19:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfMiJ-00075B-T6 for bug-guile@gnu.org; Sun, 19 Feb 2017 03:19:28 -0500 Original-Received: from mr11p00im-asmtp002.me.com ([17.110.69.253]:52113) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfMiJ-00073k-I5 for bug-guile@gnu.org; Sun, 19 Feb 2017 03:19:23 -0500 Original-Received: from process-dkim-sign-daemon.mr11p00im-asmtp002.me.com by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OLM0030047K3L00@mr11p00im-asmtp002.me.com> for bug-guile@gnu.org; Sun, 19 Feb 2017 08:18:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=4d515a; t=1487492334; bh=OYVHl7nTPsANPPmFWWRFgpIUtwZTnaJKdKSEs/WQILs=; h=MIME-version:Content-type:To:From:Subject:Date:Message-id; b=lMyBndEGz9Q88536jrUbjoYeM/yF18UKVG6KMXEsi4O+tw2iZZxDb2ubxlziEif6d lWWsIz3GLUMjIdzORvej9KVSq0wBrWgYetb9WyOtUAU9FWdvoPYgX6yYibIAixRGBC DS6ZklhaWwEmG8rVB8HzV4ianDtGkV2lv+fux/kayqG5YCjpuFHQei6MCzuWFzKXnt zpe6LzjVCwdxHlnlN4F8op9+sr14nQ02kG1dQAoTOoIsPjL5h7rEZMLcuUBulYkejk qQnPFddfjlvFmVEQ9nQ9aN2yYvY09pwchXe4BkTSYj4N8QLSKeaCxoKnJ8Y0jYfwKu 9wVb6EGWmCoYw== Original-Received: from pv33p04im-spool002.me.com ([17.143.181.41]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTP id <0OLM003GC4FH3V20@mr11p00im-asmtp002.me.com> for bug-guile@gnu.org; Sun, 19 Feb 2017 08:18:54 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-19_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1702190085 Original-Received: from localhost ([17.143.181.83]) by pv33p04im-spool002.mac.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTP id <0OLM00LQY4FH7L20@pv33p04im-spool002.mac.com> for bug-guile@gnu.org; Sun, 19 Feb 2017 08:18:53 +0000 (GMT) X-Mailer: iCloud MailClient17AProject113 MailServer17A64.25820-16A-1674-d2878f132b2c X-Originating-IP: [50.168.32.161] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Sun, 19 Feb 2017 03:32:17 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8551 Archived-At: --Boundary_(ID_wmrFKLr9sVXgFLllcEwyww) Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: quoted-printable Despite the "accept4 flags.=C2=A0 No ifdef as accept4 has a gnulib impleme= ntation" building 2.1.7 fails with undeclared identifier errors for SOCK_C= LOEXEC and SOCK_NONBLOCK on macOS. Wrapping the relevant sections in ifdef= SOCK_CLOEXEC and ifdef SOCK_NONBLOCK seems to work around the build failu= re, but I'm not sure if there are any problems with doing this, or why the= build isn't correctly taking advantage of the gnulib accept4 implementati= on.=0A=0A=0A=0ABuild logs here:=0A=0Ahttps://gist.github.com/ilovezfs/2486= 77aac5bededf97ce429245295cd0=0Ahttps://gist.github.com/21924118f0954831f2d= 62e7a79bef81d=0A=0A=0ABuild failure is=0A=0A```=0A=0A=C2=A0 CC=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 libguile_2.2_la-net_db.lo=0A=C2=A0 CC=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 libguile_2.2_la-socket.lo=0Asocket.c:1658:47: err= or: use of undeclared identifier 'SOCK_CLOEXEC'=0A=C2=A0 scm_c_define ("SO= CK_CLOEXEC", scm_from_int (SOCK_CLOEXEC));=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 ^=0Asocket.c:1659:48: error: use of undeclared identifier = 'SOCK_NONBLOCK'=0A=C2=A0 scm_c_define ("SOCK_NONBLOCK", scm_from_int (SOCK= _NONBLOCK));=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^=0A2 e= rrors generated.=0Amake[3]: *** [libguile_2.2_la-socket.lo] Error 1=0Amake= [2]: *** [install] Error 2=0Amake[1]: *** [install-recursive] Error 1=0Ama= ke: *** [install] Error 2=0A=0A```=0A=0A=0A=0AThe workaround I'm using is = here https://gist.githubusercontent.com/ilovezfs/90060a1be3b0478c1c89e78d2= 3377ff8/raw/eed5c6beb984e13ab52bf7942360383488cd43d3/gistfile1.txt=0A=0A``= `=0A=0Adiff --git a/libguile/socket.c b/libguile/socket.c=0Aindex 64df64f.= .446243c 100644=0A--- a/libguile/socket.c=0A+++ b/libguile/socket.c=0A@@ -= 1655,8 +1655,12 @@ scm_init_socket ()=0A =0A /* accept4 flags. No ifdef= as accept4 has a gnulib=0A implementation. */=0A+#ifdef SOCK_CLOEXE= C=0A scm_c_define ("SOCK_CLOEXEC", scm_from_int (SOCK_CLOEXEC));=0A+#end= if=0A+#ifdef SOCK_NONBLOCK=0A scm_c_define ("SOCK_NONBLOCK", scm_from_in= t (SOCK_NONBLOCK));=0A+#endif=0A =0A /* setsockopt level.=0A```=0A= --Boundary_(ID_wmrFKLr9sVXgFLllcEwyww) Content-type: multipart/related; boundary="Boundary_(ID_goXBDiSJHWdy117A31YW6Q)"; type="text/html" --Boundary_(ID_goXBDiSJHWdy117A31YW6Q) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable
Despite the "accept4 flags.  No ifdef as accept4 has a gnulib im= plementation" building 2.1.7 fails with undeclared identifier errors for S= OCK_CLOEXEC and SOCK_NONBLOCK on macOS. Wrapping the relevant sections in = ifdef SOCK_CLOEXEC and ifdef SOCK_NONBLOCK seems to work around the build failu= re, but I'm not sure if there are any problems with doing this, or why the= build isn't correctly taking advantage of the gnulib accept4 implementati= on.

Build logs here:=
https://gist.github.com/ilovezfs/248677aac5bededf97ce429245295cd0<= /div>
https://gist.github.com/21924118= f0954831f2d62e7a79bef81d
=
Build failure is
```
  CC       libgui= le_2.2_la-net_db.lo
  CC       libgu= ile_2.2_la-socket.lo
socket.c:1658:47: error: use of undeclared identif= ier 'SOCK_CLOEXEC'
  scm_c_define ("SOCK_CLOEXEC", scm_from_int (S= OCK_CLOEXEC));
         &n= bsp;           &nbs= p;            =             ^
so= cket.c:1659:48: error: use of undeclared identifier 'SOCK_NONBLOCK'
&nb= sp; scm_c_define ("SOCK_NONBLOCK", scm_from_int (SOCK_NONBLOCK));
 = ;            &= nbsp;           &nb= sp;            = ;         ^
2 errors generated.=
make[3]: *** [libguile_2.2_la-socket.lo] Error 1
make[2]: *** [inst= all] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [ins= tall] Error 2
```
Th= e workaround I'm using is here https://gist.githubusercontent.com/ilovezfs= /90060a1be3b0478c1c89e78d23377ff8/raw/eed5c6beb984e13ab52bf7942360383488cd= 43d3/gistfile1.txt
```
diff --git a/libguile/socket.c b/libguile/socke=
t.c=0Aindex 64df64f..446243c 100644=0A--- a/libguile/socket.c=0A+++ b/libg=
uile/socket.c=0A@@ -1655,8 +1655,12 @@ scm_init_socket ()=0A =0A   /* acce=
pt4 flags.  No ifdef as accept4 has a gnulib=0A      implementation.  */=0A=
+#ifdef SOCK_CLOEXEC=0A   scm_c_define ("SOCK_CLOEXEC", scm_from_int (SOCK=
_CLOEXEC));=0A+#endif=0A+#ifdef SOCK_NONBLOCK=0A   scm_c_define ("SOCK_NON=
BLOCK", scm_from_int (SOCK_NONBLOCK));=0A+#endif=0A =0A   /* setsockopt le=
vel.
```
= --Boundary_(ID_goXBDiSJHWdy117A31YW6Q)-- --Boundary_(ID_wmrFKLr9sVXgFLllcEwyww)--