ECS 150 – Course Introduction Prof. Joël Porquet-Lupine UC Davis – 2020/2021 Copyright © 2017-2021 Joël Porquet-Lupine – CC BY-NC-SA 4.0 International License / 1/9…
#include #include #include int main(void) { int fd; printf(“Hello #1 ”); fd = open(“myfile.txt”, O_WRONLY | O_CREAT, 0644); dup2(fd, STDOUT_FILENO); close(fd); printf(“Hello #2 ”); return…
#include #include int main(void) { printf(“Hello “); sleep(2); printf(“world! ”); write(STDOUT_FILENO, “Hello “, 6); sleep(2); write(STDOUT_FILENO, “world! “, 7); return 0; }
ECS 150 – OS Introduction Prof. Joël Porquet-Lupine UC Davis – 2020/2021 Copyright © 2017-2021 Joël Porquet-Lupine – CC BY-NC-SA 4.0 International License / 1…
#include #include int main(void) { pid_t pid; pid = fork(); if (pid > 0) printf(“I’m the parent! ”); else if (pid == 0) printf(“I’m the…
#include #include #include void alarm_handler(int signum) { printf(“ Beep, beep, beep! ”); } int main(void) { struct sigaction sa; sigset_t ss; /* Ignore Ctrl-C */…
ECS 150 – Project 1 Prof. Joël Porquet-Lupine UC Davis – 2020/2021 Copyright © 2017-2021 Joël Porquet-Lupine – CC BY-NC-SA 4.0 International License / 1…
#include #include #include #include int main(void) { pid_t pid; pid = fork(); if (pid != 0) { /* Parent */ int status; wait(&status); /* ==…
Cryptography Basics – (Pseudo)Randomness ECEN 4133 Jan 21, 2021 Review •Integrity of messages between Alice and Bob •Alice appends bits that only Alice (and Bob)…
#include #include int main(void) { char *cmd = “/bin/echo”; char *args[] = { cmd, “ECS150”, NULL}; int ret; printf(“Hi! ”); ret = execv(cmd, args); printf(“Execv…