unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] socket: define SOCK_[CLOEXEC,NONBLOCK] on Darwin
@ 2020-07-29 18:06 Aleix Conchillo Flaqué
  2020-07-29 19:08 ` Aleix Conchillo Flaqué
  0 siblings, 1 reply; 2+ messages in thread
From: Aleix Conchillo Flaqué @ 2020-07-29 18:06 UTC (permalink / raw)
  To: guile-devel


[-- Attachment #1.1: Type: text/plain, Size: 147 bytes --]

Hi,

I'm not 100% sure this is correct even though I have found it to be the
solution in other patches on other projects.

Hope this helps,

Aleix

[-- Attachment #1.2: Type: text/html, Size: 824 bytes --]

[-- Attachment #2: 0001-socket-define-SOCK_-CLOEXEC-NONBLOCK-on-Darwin.patch --]
[-- Type: application/octet-stream, Size: 1254 bytes --]

From 054e70d20bc48ed74875dcda6eea755579d80fa0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= <aconchillo@gmail.com>
Date: Wed, 29 Jul 2020 10:58:34 -0700
Subject: [PATCH] socket: define SOCK_[CLOEXEC,NONBLOCK] on Darwin

* libguile/socket.c (scm_init_socket): define SOCK_CLOEXEC and
SOCK_NONBLOCK on Darwin with O_CLOEXEC and O_NONBLOCK respectively.
---
 libguile/socket.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libguile/socket.c b/libguile/socket.c
index 64354f1f1..88ed34077 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -34,6 +34,7 @@
 #include <string.h>
 #endif
 #include <unistd.h>
+#include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #ifdef HAVE_UNIX_DOMAIN_SOCKETS
@@ -1660,9 +1661,13 @@ scm_init_socket ()
   /* accept4 flags.  */
 #ifdef SOCK_CLOEXEC
   scm_c_define ("SOCK_CLOEXEC", scm_from_int (SOCK_CLOEXEC));
+#elif defined __MACH__ && defined __APPLE__
+  scm_c_define ("SOCK_CLOEXEC", scm_from_int (O_CLOEXEC));
 #endif
 #ifdef SOCK_NONBLOCK
   scm_c_define ("SOCK_NONBLOCK", scm_from_int (SOCK_NONBLOCK));
+#elif defined __MACH__ && defined __APPLE__
+  scm_c_define ("SOCK_NONBLOCK", scm_from_int (O_NONBLOCK));
 #endif
 
   /* setsockopt level.
-- 
2.27.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] socket: define SOCK_[CLOEXEC,NONBLOCK] on Darwin
  2020-07-29 18:06 [PATCH] socket: define SOCK_[CLOEXEC,NONBLOCK] on Darwin Aleix Conchillo Flaqué
@ 2020-07-29 19:08 ` Aleix Conchillo Flaqué
  0 siblings, 0 replies; 2+ messages in thread
From: Aleix Conchillo Flaqué @ 2020-07-29 19:08 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

I believe this needs extra work, since (accept) is not happy now. I'll keep
you updated.

Aleix

On Wed, Jul 29, 2020, 11:06 AM Aleix Conchillo Flaqué <aconchillo@gmail.com>
wrote:

> Hi,
>
> I'm not 100% sure this is correct even though I have found it to be the
> solution in other patches on other projects.
>
> Hope this helps,
>
> Aleix
>
>

[-- Attachment #2: Type: text/html, Size: 1319 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-29 19:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 18:06 [PATCH] socket: define SOCK_[CLOEXEC,NONBLOCK] on Darwin Aleix Conchillo Flaqué
2020-07-29 19:08 ` Aleix Conchillo Flaqué

unofficial mirror of guile-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-devel/0 guile-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-devel guile-devel/ https://yhetil.org/guile-devel \
		guile-devel@gnu.org
	public-inbox-index guile-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.devel
	nntp://news.gmane.io/gmane.lisp.guile.devel


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git