2001-11-13 13:37:05 -05:00
|
|
|
; some useful utilities
|
|
|
|
|
2002-01-08 09:02:39 -05:00
|
|
|
(define (host-name-or-ip addr)
|
|
|
|
(with-fatal-error-handler
|
|
|
|
(lambda (condition more)
|
|
|
|
(call-with-values
|
|
|
|
(lambda () (socket-address->internet-address addr))
|
|
|
|
(lambda (ip port)
|
|
|
|
(format-internet-host-address ip))))
|
|
|
|
(host-info:name (host-info addr))))
|
|
|
|
|
2002-05-08 08:04:56 -04:00
|
|
|
(define (on-interrupt interrupt thunk)
|
|
|
|
(let lp ((event (most-recent-sigevent)))
|
|
|
|
(let ((next (next-sigevent event interrupt)))
|
|
|
|
(thunk)
|
|
|
|
(lp next))))
|