aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.vscode/c_cpp_properties.json2
-rw-r--r--csci4061/101920_breakout/pipe_template.c7
2 files changed, 1 insertions, 8 deletions
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
index c80bfaa..e42bd88 100644
--- a/.vscode/c_cpp_properties.json
+++ b/.vscode/c_cpp_properties.json
@@ -8,7 +8,7 @@
"${workspaceFolder}/**"
],
"defines": [],
- "cStandard": "c18",
+ "cStandard": "c17",
"cppStandard": "c++20"
}
],
diff --git a/csci4061/101920_breakout/pipe_template.c b/csci4061/101920_breakout/pipe_template.c
index bb59d8d..2c37941 100644
--- a/csci4061/101920_breakout/pipe_template.c
+++ b/csci4061/101920_breakout/pipe_template.c
@@ -20,7 +20,6 @@
int main(void) {
// Open pipe
- // TODO
int ends[2];
pipe(ends);
@@ -38,13 +37,10 @@ int main(void) {
printf("Parent Sending: %s\n", string_to_send);
// Parent doesn't need read file descriptor
- // TODO
close(ends[0]);
// Write the string to the pipe
- // TODO
write(ends[1], string_to_send, bytes_to_send_recv);
// Done writing
- // TODO
close(ends[1]);
// Wait for child to terminate
wait(NULL);
@@ -55,13 +51,10 @@ int main(void) {
char *recv_buffer = malloc(bytes_to_send_recv);
// Child doesn't need write file descriptor
- // TODO
close(ends[1]);
// Read the string from the pipe
- // TODO
read(ends[0], recv_buffer, bytes_to_send_recv);
// Done reading
- // TODO
close(ends[0]);
// Print result
printf("Child Received: %s\n", recv_buffer);