summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2019-05-22 20:45:24 -0600
committermo <mo.khan@gmail.com>2019-05-22 20:45:24 -0600
commiteee99baba0c7fe58d1cafc47dda5096650d41ca1 (patch)
tree89801ac8aa2dec299ef5cc5d4e5ff6b43e33521c
parentc2b575e70cfc74a95d52561809f5d612fc886d99 (diff)
write tiny c program
-rw-r--r--Makefile14
-rw-r--r--README.md2
-rw-r--r--src/temperature.c5
-rw-r--r--src/temperature.h1
-rw-r--r--temperature.obin0 -> 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
diff --git a/README.md b/README.md
index 870d624..868f2c2 100644
--- a/README.md
+++ b/README.md
@@ -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
new file mode 100644
index 0000000..dfd36fb
--- /dev/null
+++ b/temperature.o
Binary files differ