Skip to content

Commit 18a5278

Browse files
committed
Add IO to OpenEducation methodology
Signed-off-by: Mihnea Firoiu <[email protected]>
1 parent eb0056b commit 18a5278

File tree

339 files changed

+1458
-4478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+1458
-4478
lines changed
File renamed without changes.

chapters/io/Makefile

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
RVMD = reveal-md
2+
MDPP = markdown-pp
3+
FFMPEG = ffmpeg
4+
5+
SLIDES ?= slides.mdpp
6+
SLIDES_OUT ?= slides.md
7+
MEDIA_DIR ?= media
8+
SITE ?= _site
9+
OPEN ?= xdg-open
10+
11+
.PHONY: all html clean videos
12+
13+
all: videos html
14+
15+
html: $(SITE)
16+
17+
$(SITE): $(SLIDES)
18+
$(MDPP) $< -o $(SLIDES_OUT)
19+
$(RVMD) $(SLIDES_OUT) --static $@
20+
21+
videos:
22+
for TARGET in $(TARGETS); do \
23+
$(FFMPEG) -framerate 0.5 -f image2 -y \
24+
-i "$(MEDIA_DIR)/$$TARGET/$$TARGET-%d.svg" -vf format=yuv420p $(MEDIA_DIR)/$$TARGET-generated.gif; \
25+
done
26+
27+
open: $(SITE)
28+
$(OPEN) $</index.html
29+
30+
clean:
31+
-rm -f $(MEDIA_DIR)/*-generated.gif
32+
-rm -f *~
33+
-rm -fr $(SITE) $(SLIDES_OUT)

content/chapters/io/lab/content/arena.md chapters/io/arena/reading/arena.md

+5-5

content/chapters/io/lab/support/async/c/mp_server.c chapters/io/async-io/drills/tasks/async/support/c/mp_server.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/*
2-
* SPDX-License-Identifier: BSD-3-Clause
3-
*/
1+
// SPDX-License-Identifier: BSD-3-Clause
42

53
#include <stdio.h>
64
#include <stdlib.h>

content/chapters/io/lab/support/async/c/mt_server.c chapters/io/async-io/drills/tasks/async/support/c/mt_server.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/*
2-
* SPDX-License-Identifier: BSD-3-Clause
3-
*/
1+
// SPDX-License-Identifier: BSD-3-Clause
42

53
#include <stdio.h>
64
#include <stdlib.h>

content/chapters/io/lab/support/async/c/server.c chapters/io/async-io/drills/tasks/async/support/c/server.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/*
2-
* SPDX-License-Identifier: BSD-3-Clause
3-
*/
1+
// SPDX-License-Identifier: BSD-3-Clause
42

53
#include <stdio.h>
64
#include <stdlib.h>

content/chapters/io/lab/content/async-io.md chapters/io/async-io/reading/async-io.md

+12-12

content/chapters/io/lab/solution/receive-challenges/receive_fifo.c chapters/io/beyond-network-sockets/drills/tasks/receive-challenges/support/receive_fifo.c

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/* SPDX-License-Identifier: BSD-3-Clause */
1+
// SPDX-License-Identifier: BSD-3-Clause
22

33
#include <unistd.h>
44
#include <fcntl.h>
55
#include <sys/stat.h>
66

77
#include "utils/utils.h"
88

9-
static const char fifo_path[] = "../../support/receive-challenges/apollodorus";
9+
static const char fifo_path[] = "apollodorus";
1010

1111
#ifndef BUFSIZ
1212
#define BUFSIZ 256
@@ -24,18 +24,17 @@ int main(void)
2424
*/
2525
rc = access(fifo_path, R_OK | W_OK);
2626
if (rc < 0) {
27-
remove(fifo_path);
28-
rc = mkfifo(fifo_path, 0755);
29-
DIE(rc < 0, "mkfifo");
27+
/**
28+
* TODO: `access()` has returned an error, so you need to create
29+
* the FIFO yourself.
30+
*/
3031
}
3132

32-
/* Open FIFO. */
33-
fd = open(fifo_path, O_RDONLY);
34-
DIE(fd < 0, "open");
33+
/* TODO: Open FIFO for reading. */
34+
35+
36+
/* TODO: Read flag from FIFO. */
3537

36-
/* Read flag from FIFO. */
37-
rc = read(fd, buffer, BUFSIZ);
38-
DIE(rc < 0, "read");
3938

4039
printf("Flag is: %s\n", buffer);
4140

content/chapters/io/lab/content/beyond-network-sockets.md chapters/io/beyond-network-sockets/reading/beyond-network-sockets.md

+4-4

chapters/io/client-server-model/drills/tasks/client-server/README.md

content/chapters/io/lab/content/client-server-model.md chapters/io/client-server-model/reading/client-server-model.md

+4-4

chapters/io/file-descriptors/drills/tasks/file-descriptors/README.md

content/chapters/io/lab/content/file-descriptors.md chapters/io/file-descriptors/reading/file-descriptors.md

+16-16

chapters/io/file-handlers/drills/tasks/simple-file-operations/README.md

chapters/io/file-handlers/drills/tasks/simple-file-operations/support/dir/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)