rktio: repairs for Linux

This commit is contained in:
Matthew Flatt 2017-06-16 15:40:17 -06:00
parent 8a426eb086
commit 35d47f89f6
11 changed files with 23 additions and 12 deletions

View File

@ -923,6 +923,7 @@
__acrt_iob_func ; VC 14.0 (2015)
|GetStdHandle| |__CFStringMakeConstantString|
_vswprintf_c
malloc strdup
scheme_make_small_bignum scheme_make_small_rational scheme_make_small_complex))
(define non-functions-table

View File

@ -59,7 +59,9 @@ ARLIBFLAGS = $(LDFLAGS) $(LDLIBS)
GRACKETLINKER = @MZLINKER@
GRACKETLDLIBS@NOT_MINGW@ = ../racket/libracket.@LIBSFX@ ../racket/libmzgc.@LIBSFX@ $(LDLIBS)
LIBRKTIO = ../rktio/librktio.@LTA@
GRACKETLDLIBS@NOT_MINGW@ = ../racket/libracket.@LIBSFX@ ../racket/libmzgc.@LIBSFX@ @LIBRKTIO_FOR_LIB@ $(LDLIBS)
GRACKETLDLIBS@MINGW@ = ../racket/libracket.dll.a ../racket/libmzgc.dll.a $(LDLIBS) -ldelayimp -static-libgcc
GRACKETLDFLAGS = $(LDFLAGS) -L../racket

View File

@ -92,10 +92,10 @@ GRACKETLINKER = @MZLINKER@
GRACKETLIBS_a = $(LDLIBS)
GRACKETLIBS_la =
GRACKETMZOBJS_a = $(MZOBJS)
GRACKETMZOBJS_a = $(MZOBJS) ../../rktio/librktio.@LTA@
GRACKETMZOBJS_la =
../gracket@MMM@@NOT_OSX@@NOT_MINGW@: grmain.@LTO@ ../../racket/libracket3m.@LIBSFX@
../gracket@MMM@@NOT_OSX@@NOT_MINGW@: grmain.@LTO@ ../../racket/libracket3m.@LIBSFX@ @LIBRKTIO_FOR_LIB@
$(GRACKETLINKER) $(GRACKETLDFLAGS) -o ../gracket@MMM@ grmain.@LTO@ ../../racket/libracket3m.@LIBSFX@ $(GRACKETMZOBJS_@LIBSFX@) $(GRACKETLIBS_@LIBSFX@)
../gracket@MMM@@MINGW@: grmain.@LTO@ ../../racket/gc2/libracket3m.dll.a ../gres.o

View File

@ -512,7 +512,7 @@ EXTRA_OBJS_L = $(EXTRA_GMP) ../src/unwind.@LTO@ $(@FOREIGN_IF_USED@_OBJSLIB) @LI
$(RANLIB) ../libracket3m.@LIBSFX@
../racket@MMM@@NOT_OSX@@NOT_MINGW@: main.@LTO@ ../libracket3m.@LIBSFX@ @LIBRKTIO_FOR_LIB@
cd ..; @MZLINKER@ -o racket@MMM@ @PROFFLAGS@ gc2/main.@LTO@ libracket3m.@LIBSFX@ @LIBRKTIO_FOR_LIB@ @LDFLAGS@ $(LIBS)
cd ..; @MZLINKER@ -o racket@MMM@ @PROFFLAGS@ gc2/main.@LTO@ libracket3m.@LIBSFX@ gc2/@LIBRKTIO_FOR_LIB@ @LDFLAGS@ $(LIBS)
# The above "cd .." prevents a problem with libtool's generated script in --enable-shared mode,
# at least for Mac OS X. Beware of changing LIBS or LDFLAGS to inclucde something with a relative

View File

@ -503,7 +503,6 @@ static intptr_t tcp_do_write_string(Scheme_Output_Port *port,
can be flushed immediately, never ever blocking. */
Scheme_Tcp *data;
int would_block = 0;
intptr_t sent;
data = (Scheme_Tcp *)port->port_data;
@ -547,7 +546,6 @@ static intptr_t tcp_do_write_string(Scheme_Output_Port *port,
}
/* Ok - try again! */
would_block = 0;
goto top;
}

View File

@ -33,6 +33,9 @@
#include "schmach.h"
#include "schrktio.h"
#include <errno.h>
#ifndef DONT_IGNORE_PIPE_SIGNAL
# include <signal.h>
#endif
#define mzAssert(x) /* if (!(x)) abort() */
@ -3723,7 +3726,7 @@ scheme_do_open_output_file(char *name, int offset, int argc, Scheme_Object *argv
} else {
#if 0
/* Add a way to get this information from rktio_open()? */
if (???)
if (....)
scheme_raise_exn(MZEXN_FAIL_FILESYSTEM,
"%s: error deleting file\n"
" path: %q\n"
@ -6037,6 +6040,10 @@ static Scheme_Object *subprocess(int c, Scheme_Object *args[])
block_timer_signals(0);
if (need_forget_in) rktio_forget(scheme_rktio, stdin_fd);
if (need_forget_out) rktio_forget(scheme_rktio, stdout_fd);
if (need_forget_err) rktio_forget(scheme_rktio, stderr_fd);
if (envvars)
rktio_envvars_free(scheme_rktio, envvars);

View File

@ -1024,7 +1024,8 @@ intptr_t rktio_write(rktio_t *rktio, rktio_fd_t *rfd, const char *buffer, intptr
if (len == -1) {
errsaved = errno;
get_posix_error();
}
} else
errsaved = 0;
if (!(flags & RKTIO_NONBLOCKING))
fcntl(rfd->fd, F_SETFL, flags);

View File

@ -8,6 +8,7 @@
#endif
#if defined(HAVE_INOTIFY_SYSCALL)
# include <poll.h>
# include <unistd.h>
# include <sys/inotify.h>
#endif
@ -24,7 +25,7 @@
static void do_inotify_init(rktio_t *rktio);
static int do_inotify_ready(rktio_t *rktio);
static int do_inotify_errid(rktio_t *rktio);
static int do_inotify_add(rktio_t *rktio, char *filename);
static int do_inotify_add(rktio_t *rktio, const char *filename);
static void do_inotify_remove(rktio_t *rktio, int p2);
static int do_inotify_poll(rktio_t *rktio, int p2);
static void do_inotify_stop(rktio_t *rktio);
@ -421,7 +422,7 @@ static int do_inotify_errid(rktio_t *rktio)
/* Other functions are called only if do_inotify_ready() returns 1. */
static int do_inotify_add(rktio_t *rktio, char *filename)
static int do_inotify_add(rktio_t *rktio, const char *filename)
{
rin_inotify_state_t *s = rktio->inotify_server;
int wd;

View File

@ -13,6 +13,7 @@
# include <sys/time.h>
#endif
#ifdef HAVE_POLL_SYSCALL
# include <unistd.h>
# include <poll.h>
#endif
#ifdef HAVE_EPOLL_SYSCALL

View File

@ -666,7 +666,7 @@ void rktio_reap_processes(rktio_t *rktio)
{
if (rktio->need_to_check_children) {
rktio->need_to_check_children = 0;
check_child_done(0);
check_child_done(rktio, 0);
}
}

View File

@ -449,7 +449,7 @@ rktio_date_t *rktio_seconds_to_date(rktio_t *rktio, rktio_timestamp_t seconds, i
}
# endif
# ifdef USE_TIMEZONE_VAR_W_DLS
tzoffset = -(MSCBOR_IZE(timezone) - (dst ? 3600 : 0));
tzoffset = -(MSC_IZE(timezone) - (dst ? 3600 : 0));
# endif
# ifdef USE_TIMEZONE_AND_ALTZONE_VAR
if (dst)