STDEXT_OBJS = filenameext stringext arrayext hashtblext listext pervasiveext threadext ring \
qring fring opt bigbuffer unixext range vIO trie config date encodings forkhelpers \
- gzip sha1sum sigutil zerocheck base64 backtrace tar
+ gzip sha1sum zerocheck base64 backtrace tar
INTF = $(foreach obj, $(STDEXT_OBJS),$(obj).cmi)
LIBS = stdext.cma stdext.cmxa
stdext.cma: $(foreach obj,$(STDEXT_OBJS),$(obj).cmo)
$(OCAMLC) -a -dllib dllstdext_stubs.so -cclib -lstdext_stubs -o $@ $(foreach obj,$(STDEXT_OBJS),$(obj).cmo)
-stdext_stubs.a: unixext_stubs.o sigutil_stub.o zerocheck_stub.o
+stdext_stubs.a: unixext_stubs.o zerocheck_stub.o
ocamlmklib -o stdext_stubs $+
-libstdext_stubs.a: unixext_stubs.o sigutil_stub.o zerocheck_stub.o
+libstdext_stubs.a: unixext_stubs.o zerocheck_stub.o
ar rcs $@ $+
ocamlmklib -o stdext_stubs $+
+++ /dev/null
-(*
- * Copyright (C) 2006-2009 Citrix Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *)
-external install_fpe_handler : unit -> unit = "stub_install_fpe_handler"
-external install_segv_handler : unit -> unit = "stub_install_segv_handler"
+++ /dev/null
-(*
- * Copyright (C) 2006-2009 Citrix Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *)
-external install_fpe_handler : unit -> unit = "stub_install_fpe_handler"
-external install_segv_handler : unit -> unit = "stub_install_segv_handler"
+++ /dev/null
-/*
- * Copyright (C) 2006-2009 Citrix Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- */
-
-#include <sys/types.h>
-#include <signal.h>
-#include <unistd.h>
-#include <stdio.h>
-
-static void fpe_handler(int signum, siginfo_t *info, void *ptr)
-{
- FILE *file;
- if (signum != SIGFPE || info == NULL)
- return;
- file = fopen("/tmp/fpe_dump", "w+");
- if (file == NULL)
- return;
-
- fprintf(file, "si_signo: %d\n", info->si_signo);
- fprintf(file, "si_errno: %d\n", info->si_errno);
- fprintf(file, "si_code: %d\n", info->si_code);
- fprintf(file, "si_pid: %d\n", info->si_pid);
- fprintf(file, "si_status: %d\n", info->si_status);
- fprintf(file, "si_value: %d\n", info->si_value);
- fprintf(file, "si_int: %lx\n", info->si_int);
- fprintf(file, "si_ptr: %lx\n", (unsigned long) info->si_ptr);
- fprintf(file, "si_addr: %lx\n", (unsigned long) info->si_addr);
- fprintf(file, "uarg: %lx\n", (unsigned long) ptr);
- fclose(file);
-
- kill(0, SIGFPE);
-}
-
-static void segv_handler(int signum, siginfo_t *info, void *ptr)
-{
- FILE *file;
- if (signum != SIGSEGV || info == NULL)
- return;
- file = fopen("/tmp/segv_dump", "w+");
- if (file == NULL)
- return;
-
- fprintf(file, "si_signo: %d\n", info->si_signo);
- fprintf(file, "si_errno: %d\n", info->si_errno);
- fprintf(file, "si_code: %d\n", info->si_code);
- fprintf(file, "si_pid: %d\n", info->si_pid);
- fprintf(file, "si_status: %d\n", info->si_status);
- fprintf(file, "si_value: %d\n", info->si_value);
- fprintf(file, "si_int: %lx\n", info->si_int);
- fprintf(file, "si_ptr: %lx\n", (unsigned long) info->si_ptr);
- fprintf(file, "si_addr: %lx\n", (unsigned long) info->si_addr);
- fprintf(file, "uarg: %lx\n", (unsigned long) ptr);
- fclose(file);
-
- kill(0, SIGSEGV);
-}
-
-#define CAML_NAME_SPACE
-#include <caml/alloc.h>
-#include <caml/memory.h>
-#include <caml/signals.h>
-#include <caml/fail.h>
-
-CAMLprim value stub_install_fpe_handler(value unit)
-{
- CAMLparam1(unit);
- struct sigaction act;
-
- act.sa_sigaction = fpe_handler;
- act.sa_flags = SA_SIGINFO | SA_RESETHAND;
-
- sigaction(SIGFPE, &act, NULL);
-
- CAMLreturn(Val_unit);
-}
-
-CAMLprim value stub_install_segv_handler(value unit)
-{
- CAMLparam1(unit);
- struct sigaction act;
- act.sa_sigaction = segv_handler;
- act.sa_flags = SA_SIGINFO | SA_RESETHAND;
-
- sigaction(SIGSEGV, &act, NULL);
-
- CAMLreturn(Val_unit);
-}