diff options
| author | mo <mo.khan@gmail.com> | 2019-05-22 20:45:24 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2019-05-22 20:45:24 -0600 |
| commit | eee99baba0c7fe58d1cafc47dda5096650d41ca1 (patch) | |
| tree | 89801ac8aa2dec299ef5cc5d4e5ff6b43e33521c | |
| parent | c2b575e70cfc74a95d52561809f5d612fc886d99 (diff) | |
write tiny c program
| -rw-r--r-- | Makefile | 14 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | src/temperature.c | 5 | ||||
| -rw-r--r-- | src/temperature.h | 1 | ||||
| -rw-r--r-- | temperature.o | bin | 0 -> 5632 bytes |
5 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5418524 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +SHELL=/bin/sh +CFLAGS=-Wall -g -std=c99 -Isrc +objects=temperature.o +exe=./bin/temperature + +all: $(objects) + $(CC) $(CFLAGS) -o $(exe) $(objects) + $(exe) + +clean: + rm -fr $(Explaine) $(objects) + +temperature.o: src/temperature.c src/temperature.h + $(CC) $(CFLAGS) -c src/temperature.c @@ -314,7 +314,9 @@ $ cp /etc/passwd dir1 See `exercises/chapter-8.13`. 14. What umask command should be executed to set the permissions bit mask to 037? With this mask, what default access privileges are associated with any new file that you create on the system? Why? Where would you put this command so that every time you log on to the system this mask is effective? + 15. Give a command line for setting the default access mode so that you have read, write, and execute privileges, your group has read and execute permissions, and all others have no permission for a newly created executable file or directory. How would you test it to be sure that it works correctly? + 16. Give chmod command lines that perform the same tasks that the mesg n and mesg y commands do. (Hint: Every hardware device, including your terminal, has an associated file in the /dev directory.) 17. What are the purposes of the set-user-ID (SUID), set-group-ID (SGID), and sticky bits? diff --git a/src/temperature.c b/src/temperature.c new file mode 100644 index 0000000..de6c280 --- /dev/null +++ b/src/temperature.c @@ -0,0 +1,5 @@ +#include <stdio.h> + +int main(int argc, char **argv) { + printf("Hello"); +} diff --git a/src/temperature.h b/src/temperature.h new file mode 100644 index 0000000..53c5fdf --- /dev/null +++ b/src/temperature.h @@ -0,0 +1 @@ +#include <stdio.h> diff --git a/temperature.o b/temperature.o Binary files differnew file mode 100644 index 0000000..dfd36fb --- /dev/null +++ b/temperature.o |
