From eee99baba0c7fe58d1cafc47dda5096650d41ca1 Mon Sep 17 00:00:00 2001 From: mo Date: Wed, 22 May 2019 20:45:24 -0600 Subject: write tiny c program --- Makefile | 14 ++++++++++++++ README.md | 2 ++ src/temperature.c | 5 +++++ src/temperature.h | 1 + temperature.o | Bin 0 -> 5632 bytes 5 files changed, 22 insertions(+) create mode 100644 Makefile create mode 100644 src/temperature.c create mode 100644 src/temperature.h create mode 100644 temperature.o 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 + +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 diff --git a/temperature.o b/temperature.o new file mode 100644 index 0000000..dfd36fb Binary files /dev/null and b/temperature.o differ -- cgit v1.2.3