projects
/
rrq
/
rrqforth.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed generated
[rrq/rrqforth.git]
/
examples
/
uenventlog.f
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
;
" 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
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 >
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
ELSE S" ** Error: " TELL . NL EMIT
THEN
AGAIN