aboutsummaryrefslogtreecommitdiffstats
path: root/csci4061/101920_breakout
diff options
context:
space:
mode:
authorMatthew Strapp <msattr@gmail.com>2020-10-19 08:19:15 -0500
committerMatthew Strapp <msattr@gmail.com>2020-10-19 08:19:15 -0500
commit09b288816fab88b16dbb696189963dbe56e773b6 (patch)
tree9e9b304ab97225c20865c8c9b02b4611f62ae299 /csci4061/101920_breakout
parentadd breakouts (diff)
downloadhomework-09b288816fab88b16dbb696189963dbe56e773b6.tar
homework-09b288816fab88b16dbb696189963dbe56e773b6.tar.gz
homework-09b288816fab88b16dbb696189963dbe56e773b6.tar.bz2
homework-09b288816fab88b16dbb696189963dbe56e773b6.tar.lz
homework-09b288816fab88b16dbb696189963dbe56e773b6.tar.xz
homework-09b288816fab88b16dbb696189963dbe56e773b6.tar.zst
homework-09b288816fab88b16dbb696189963dbe56e773b6.zip
e
Diffstat (limited to '')
-rw-r--r--csci4061/101920_breakout/pipe_template.c7
1 files changed, 0 insertions, 7 deletions
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);