-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IO to OpenEducation methodology #75
base: main
Are you sure you want to change the base?
Conversation
a351b9b
to
d84d43a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check my comments to see some easy first fixes and also why the build fails. Then when it passes I'll make a more in-depth review.
- Move the task descriptions from the
reading/
files to each task'sREADME.md
- Remove references to the common makefiles (
.../common/makefile/*.mk
). Copy their content to each makefile that includes them so the tasks don't depend on outside resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to add the task description to this README file.
@@ -0,0 +1,79 @@ | |||
/* SPDX-License-Identifier: BSD-3-Clause */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* SPDX-License-Identifier: BSD-3-Clause */ | |
// SPDX-License-Identifier: BSD-3-Clause |
Use //
for SPDX tags in .c
files and /* ... */
for .h
s.
@@ -0,0 +1,15 @@ | |||
/* SPDX-License-Identifier: BSD-3-Clause */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* SPDX-License-Identifier: BSD-3-Clause */ | |
// SPDX-License-Identifier: BSD-3-Clause |
@@ -0,0 +1,74 @@ | |||
/* SPDX-License-Identifier: BSD-3-Clause */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* SPDX-License-Identifier: BSD-3-Clause */ | |
// SPDX-License-Identifier: BSD-3-Clause |
BINARIES = file_operations directory_operations | ||
include ../../../../../common/makefile/multiple.mk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove refernces to global makefiles.
BINARIES = send_fd_4 receive_pipe send_fifo receive_fifo send_unix_socket receive_unix_socket send_net_dgram_socket receive_net_dgram_socket | ||
include ../../../../../common/makefile/multiple.mk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto: Remove references to external makefiles.
student@os:~/.../lab/multiplex/support$ make | ||
gcc -g -Wall -Wextra -I../../../../../common/makefile/.. -c -o epoll_echo_server.o epoll_echo_server.c | ||
gcc -g -Wall -Wextra -I../../../../../common/makefile/.. -c -o ../../../../../common/makefile/../utils/log/log.o ../../../../../common/makefile/../utils/log/log.c | ||
gcc -g -Wall -Wextra -I../../../../../common/makefile/.. -c -o ../../../../../common/utils/sock/sock_util.o ../../../../../common/utils/sock/sock_util.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After making the makefiles standalone, re-run these make
commands and paste the new output here.
2. Now, it is interesting to see how we can force libc to dump that internal buffer. | ||
The most direct way is by using the `fflush()` library call, which is made for this exact purpose. | ||
But we can be more subtle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Now, it is interesting to see how we can force libc to dump that internal buffer. | |
The most direct way is by using the `fflush()` library call, which is made for this exact purpose. | |
But we can be more subtle. | |
1. Now, it is interesting to see how we can force libc to dump that internal buffer. | |
The most direct way is by using the `fflush()` library call, which is made for this exact purpose. | |
But we can be more subtle. |
2. Now, it is interesting to see how we can force libc to dump that internal buffer. | |
The most direct way is by using the `fflush()` library call, which is made for this exact purpose. | |
But we can be more subtle. | |
Add a `\n` in some of the strings printed in `buffering/support/printf_buffering.c`. | |
Place them wherever you want (at the beginning, end, or middle). | |
Recompile the code and observe its change in behaviour under `strace`. |
You don't need to disable MD029
above. Remove the comment above that disables this rule and add a tab to each new line within the same numbered list item to keep the rendered numbering correct. Do the same for the list item above.
Add a `\n` in some of the strings printed in `buffering/support/printf_buffering.c`. | ||
Place them wherever you want (at the beginning, at the end, in the middle). | ||
Recompile the code and observe its change in behaviour under `strace`. | ||
|
||
<!-- markdownlint-enable MD029 --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a `\n` in some of the strings printed in `buffering/support/printf_buffering.c`. | |
Place them wherever you want (at the beginning, at the end, in the middle). | |
Recompile the code and observe its change in behaviour under `strace`. | |
<!-- markdownlint-enable MD029 --> | |
Add a `\n` in some of the strings printed in `buffering/support/printf_buffering.c`. | |
Place them wherever you want (at the beginning, end, or middle). | |
Recompile the code and observe its change in behaviour under `strace`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is broken. That's why the build fails.
Signed-off-by: Mihnea Firoiu <[email protected]>
d84d43a
to
18a5278
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build fails because chapters/io/arena/drills/tasks/mini-shell/
is missing its support/
folder which causes the Makefile symlink to point to an invalid path.
@@ -0,0 +1,19 @@ | |||
#! /bin/bash | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# SPDX-License-Identifier: BSD-3-Clause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the include
and copy-paste the contents of the included makefile here so the task doesn't have outside dependencies.
|
||
IP = "127.0.0.1" # Loopback IP address (localhost) | ||
MAX_MESSAGE_LENGTH = 1024 | ||
PORT = 5000 # Port to listen for data data on (non-privileged ports are > 1023) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PORT = 5000 # Port to listen for data data on (non-privileged ports are > 1023) | |
PORT = 5000 # Port to listen for data (non-privileged ports are > 1023) |
Prerequisite Checklist
Description of changes