[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/5] Improve portability (particularly for Woe32)
From: |
Georgiy Tugai |
Subject: |
Re: [PATCH 2/5] Improve portability (particularly for Woe32) |
Date: |
Fri, 26 Mar 2021 11:29:58 +0000 |
See inline replies.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, March 26, 2021 11:53 AM, Jose E. Marchesi <jemarch@gnu.org> wrote:
>
>
> Hi Georgiy.
>
> Thanks for the patch. See some comments below.
>
> > diff --git a/configure.ac b/configure.ac
> > index e40b3a4e..7ca26abb 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -98,11 +98,20 @@ dnl emitted in case no proper AWK is present.
> > AX_CHECK_AWK_GENSUB([RAS_AWK=$AWK], [RAS_AWK=:])
> > AC_SUBST([RAS_AWK])
> > +dnl REPL
>
> I would explain a bit better why we are checking for siglongjmp.
> Something in the line "The poke REPL uses siglongjmp in order to handle
> Ctrl-C and other events that result on signals in most platforms.".
Sure.
> > -
> >
> > +AC_CHECK_FUNCS([siglongjmp], break)
> > +
>
> I don't think the `break' there is necessary?
I may have misread the AC_CHECK_FUNCS docs; there was something about
"use break if you don't want to continue checking" there.
> > diff --git a/poke/pk-hserver.c b/poke/pk-hserver.c
> > index 873020f1..c1fca81f 100644
> > --- a/poke/pk-hserver.c
> > +++ b/poke/pk-hserver.c
> > @@ -27,6 +27,7 @@
> > #include <sys/time.h>
> > #include <sys/types.h>
> > #include <sys/socket.h>
> > +#include <sys/select.h>
> > #include <netinet/in.h>
> > #include <arpa/inet.h>
> > #include <netdb.h>
> > diff --git a/poke/pk-mi.c b/poke/pk-mi.c
> > index 64670f5c..81188d97 100644
> > --- a/poke/pk-mi.c
> > +++ b/poke/pk-mi.c
> > @@ -26,6 +26,7 @@
> > #include <assert.h>
> > #include <fcntl.h>
> > #include <errno.h>
> > +#include <sys/select.h>
> > #include "poke.h"
> > @@ -167,6 +168,7 @@ pk_mi_send_frame_msg (const char payload)
> > / Set fd to non-blocking and return old flags or -1 on error. */static int
> > pk_mi_fd_set_nonblocking (int fd)
> > {
> > +#if defined HAVE_FCNTL
> > int flags = fcntl (fd, F_GETFL, 0);
> > if (flags >= 0 && (flags & O_NONBLOCK) == 0)
> > @@ -179,16 +181,21 @@ static int pk_mi_fd_set_nonblocking (int fd)
> > perror ("fcntl");
> > return flags;
> > +#else
> >
> > - return 0;
> > +#endif
> > }
> >
>
> There is a fcntl module in gnulib that seems to provide a sort of an
> implementation for mingw. Maybe it is enough for us in windows?
Unfortunately not. The module fixes many things, but not the ones we need.
See https://www.gnu.org/software/gnulib/manual/html_node/fcntl.html
> Portability problems not fixed by Gnulib:
>
> The replacement function does not support F_SETFD, F_GETFL, F_SETFL,
> F_GETOWN, F_SETOWN, F_GETLK, F_SETLK, and F_SETLKW on some platforms:
> mingw, MSVC 14.
[PATCH 5/5] First version of REPL Ctrl-C trampoline for Woe32, Georgiy Tugai, 2021/03/25