This commit is contained in:
Виталий Туров 2024-12-09 18:45:05 +03:00
parent 2126e4455b
commit 78b1633710
7 changed files with 26 additions and 0 deletions

BIN
bash/rest.zip Normal file

Binary file not shown.

0
c/task.c → bash/train_bash/concurrente.sh Normal file → Executable file
View File

BIN
c/pause Executable file

Binary file not shown.

6
c/pause.c Normal file
View File

@ -0,0 +1,6 @@
#include <unistd.h>
int main(void) {
pause();
return 0;
}

View File

14
python/fork.py Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
import os, sys
ret = os.fork()
if ret == 0:
print("child process: pid={}, parent process's pid={}".format(os.getpid(), os.getppid()))
os.execve("/bin/echo", ["echo", "hello from pid={} ".format(os.getpid())], {})
exit()
elif ret > 0:
print("parent process: pid={}, child process's pid={}".format(os.getpid(), ret))
exit()
sys.exit(1)

6
python/spawn.py Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/python3
import os
os.posix_spawn("/bin/echo", ["echo", "echo", "created by posix_spawn()"], {})
print("created echo command")