projects
/
rrq
/
rrqforth.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6bc4412
)
correction
author
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Mon, 8 May 2023 02:29:57 +0000
(12:29 +1000)
committer
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Mon, 8 May 2023 02:29:57 +0000
(12:29 +1000)
examples/uenventlog.f
patch
|
blob
|
history
diff --git
a/examples/uenventlog.f
b/examples/uenventlog.f
index acf62221796018f5427443ee52a81b262b8377fa..c2d13416a2951eb93b5b4079cc18a36d1fd9acde 100755
(executable)
--- a/
examples/uenventlog.f
+++ b/
examples/uenventlog.f
@@
-19,6
+19,10
@@
SYSTEM DEFINITIONS
" ROT IF TELL NL EMIT 1 EXIT THEN 2DROP
;
+: time ( -- s ; seconds since epoch )
+ 0 SYS_TIME
+;
+
HEX 100 DECIMAL CONSTANT MSG_WAITALL
HEX 80002 DECIMAL CONSTANT SOCK_DGRAM|SOCK_CLOEXEC
15 CONSTANT NETLINK_KOBJECT_UEVENT
@@
-45,7
+49,7
@@
SYS_BIND DIE" Failed to bind"
BEGIN
NL-SOCKET @ RECV-BUFFER NL_MAX_PAYLOAD MSG_WAITALL 0 0
SYS_RECVFROM DUP 0 >
- IF DROP RECV-BUFFER DUP STRLEN TELL NL EMIT
+ IF DROP
time . SP EMIT
RECV-BUFFER DUP STRLEN TELL NL EMIT
ELSE S" ** Error: " TELL . NL EMIT
THEN
AGAIN