Skip to content
Snippets Groups Projects
Commit 6f0673d5 authored by iliya.saroukha's avatar iliya.saroukha
Browse files

finished ex1

parent b2a9e9d4
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,42 @@ PID TTY TIME CMD
1 ? 00:00:02 systemd
```
# Identifiez au moins 4 groupes de processus contenant chacun au moins 5 processus et pour chacu, déterminez le _group leader_
Par contre, si l'on utilise les flags `-ef` pour la commande `ps`, le nom du
processus portant le `PID` 1 est `init` provenant de `/sbin/init splash`. En
réalité `init` est aussi `systemd` mais ce nom sera régi par la distribution
utilisée.
# Identifiez au moins 4 groupes de processus contenant chacun au moins 5 processus et pour chacun, déterminez le _group leader_
## Format
- Process(PID, PGID)
- Child process(PIDs range, PGID)
$\Rightarrow$ Group leader
## Réponses
- `Xorg`(2298, 2296)
- `{Xorg}`(2299 -- 2331, 2296)
$\Rightarrow$ `gdm-x-session`(2296, 2296)
- `evolution-alarm`(3060, 2650)
- `{evolution-alarm}`([3182 -- 3183; 3190; 3217 -- 3218; 3254], 2296)
$\Rightarrow$ `gnome-session-b`(2650, 2650)
- `fwupd`(3403, 3403)
- `{fwupd}`([3412 -- 3415; 3417], 3403)
$\Rightarrow$ `fwupd`(3403, 3403)
- `xdg-document-po`(2213, 2213)
- `{xdg-document-po}`([2214 -- 2216; 2223; 2225; 2226], 2213)
$\Rightarrow$ `xdg-document-po`(2213, 2213)
*.o
prog
CC := clang
CFLAGS := -g -pedantic -Wall -Wextra -std=c2x
LDFLAGS := -fsanitize=address -fsanitize=leak -fsanitize=undefined -lm
TARGET := prog
all: $(TARGET)
$(TARGET): prog.o
@printf "=================== Building executable ===================\n"
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
@printf "\n"
%.o: %.c
@printf "================== Building object files ==================\n"
$(CC) $(CFLAGS) -c $<
@printf "\n"
clean:
rm -f *.o $(TARGET)
#include <stdio.h>
#include <unistd.h>
int main(void) {
printf("Voilà un mystère digne de Sherlock Holmes !");
fork();
printf("\n");
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment