Skip to content

Commit 072ddac

Browse files
committed
An I/O multiplexer to monitor stdin redirect
1 parent 818ad45 commit 072ddac

File tree

4 files changed

+669
-0
lines changed

4 files changed

+669
-0
lines changed

.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ ForEachMacros:
2424
- hlist_for_each_entry
2525
- rb_list_foreach
2626
- rb_list_foreach_safe
27+
- EV_FOREACH

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [map-reduce](map-reduce/): word counting using MapReduce.
1313
- [mpmc](mpmc/): A multiple-producer/multiple-consumer (MPMC) queue.
1414
- [channel](channel/): A Linux futex based Go channel implementation.
15+
- [redirect](redirect/): An I/O multiplexer to monitor stdin redirect using `timerfd` and `epoll`.
1516

1617
## License
1718

redirect/Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
all:
2+
gcc -Wall -Wextra -o redirect main.c
3+
4+
indent:
5+
clang-format -i main.c
6+
cloc main.c
7+
8+
check: all
9+
(cat /proc/uptime ; sleep 2; cat /proc/uptime; sleep 2; cat /proc/uptime; sleep 2; cat /proc/uptime) | ./redirect
10+
clean:
11+
rm -f redirect

0 commit comments

Comments
 (0)