Re: Signal processing during FFI have no action

2023-05-02 Thread Robert Wörle

Am 02.05.2023 um 16:00 schrieb Alexander Burger:

Hi Constantine,


I wrote a function that downloads file using libcurl. I found out that
when the the downloading process in progress by `curl_easy_perform` I
cannot interrupt downloading by Ctrl-C. Even `killall picolisp` does
not work.

How I can make signals work during FFI?


Mayb try the NOPROGRESS option from libcurl like this

https://curl.se/libcurl/c/CURLOPT_NOPROGRESS.html

Maybe that changes something

regards rob


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Signal processing during FFI have no action

2023-05-02 Thread Alexander Burger
Hi Constantine,

> I wrote a function that downloads file using libcurl. I found out that
> when the the downloading process in progress by `curl_easy_perform` I
> cannot interrupt downloading by Ctrl-C. Even `killall picolisp` does
> not work.
> 
> How I can make signals work during FFI?

PicoLisp FFI does not do anything with signals. However, PicoLisp itself sets a
signal handler for SIGINT (which is normally sent by Ctrl-C) to interrupt
running Lisp code and drop into a breakpoint.

While code is executing in a library like libcurl, all signals defined to be
handled by PicoLisp will be *delayed* until the native code completes and Lisp
takes back control.

Note that killing will indeed work if you don't start a REPL (i.e. in a script).
Then SIGINT retains its default behavior of terminating the process.


I see no way at the moment for a native function called from a REPL, simply
because such foreign functions do not know about Pil's signals.

What if you do

   (call "curl" ...)

instead of a native call, and kill the curl process?

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Signal processing during FFI have no action

2023-05-02 Thread Constantine Bytensky
Hello!

I wrote a function that downloads file using libcurl. I found out that
when the the downloading process in progress by `curl_easy_perform` I
cannot interrupt downloading by Ctrl-C. Even `killall picolisp` does
not work.

How I can make signals work during FFI?

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Subscribe

2023-05-02 Thread Constantine Bytensky
Hello Constantine Bytensky  :-)
You are now subscribed




-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe