Pull to refresh
0
0
Send message
Какое-то переизобретение велосипеда. Предположу, что у пользователей с Windows и MacOS нет такой проблемы с роутами. Это значит, что они отдаются сервером в виде HTTP Header-ов, это можно посмотреть, если подключиться с опцией --verbose.
Ещё у openconnect есть штатный механизм для обработки этих header-ов, называется vpnc-script, если запустить openconnect c --script /usr/share/vpnc-scripts/vpnc-script (значение по умолчанию) не передавая никаких параметров, то он и resolv.conf поправит (или dnsmasq) и роуты нужные добавит на основании данных от VPN. Но, вероятно, в вашей версии Ubuntu что-то идёт не так, у меня на 16.04 и 18.04 всё ок.
Пример заголовков:
X-CSTP-DNS: nameserver1
X-CSTP-Split-Exclude: 0.0.0.0/255.255.255.255
X-CSTP-Split-Include: 172.14.24.0/255.255.255.0
Не расскрыта самая значительная часть шифрования почты в корпоративной среде, а именно получение открытого ключа адресата.
А чем createrepo_c не подошел?
Значит это было не кардио. Час бега в аэробном режиме и час бега в состоянии закисления это разные вещи. Да, организм может работать при определенной концентрации лактата. Молочная кислота образуется в мышцах и выводится для дальнейшего окисления в другие мышцы, которые сейчас менее загружены.
вот отсюда http://man7.org/linux/man-pages/man3/posix_spawn.3.html
The posix_spawn() and posix_spawnp() functions are used to create a
new child process that executes a specified file. These functions
were specified by POSIX to provide a standardized method of creating
new processes on machines that lack the capability to support the
fork(2) system call. These machines are generally small, embedded
systems lacking MMU support.

Если не нужно шарить память и прочее с родительским процессом, то clone() не требуется.
C library/kernel differences
Since version 2.3.3, rather than invoking the kernel's fork() system call, the glibc fork() wrapper that is provided as part of the NPTL threading implementation invokes clone(2) with flags that pro‐
vide the same effect as the traditional system call. (A call to fork() is equivalent to a call to clone(2) specifying flags as just SIGCHLD.)

Т.е. GlibС-шный fork() из glibc по факту вызывает clone(2).
Правильный ответ на этот вопрос на любом собеседовании – ничего. Fork – устаревший вызов, и в linux присутствует только для обратной совместимости.

А можно пруф про устаревший fork?
man fork:
fork() creates a new process by duplicating the calling process. The new process is referred to as the child process. The calling process is referred to as the parent process.

The child process and the parent process run in separate memory spaces. At the time of fork() both memory spaces have the same content. Memory writes, file mappings (mmap(2)), and unmappings (mun‐
map(2)) performed by one of the processes do not affect the other.


man clone
clone() creates a new process, in a manner similar to fork(2)

Unlike fork(2), clone() allows the child process to share parts of its execution context with the calling process, such as the memory space, the table of file descriptors, and the table of signal
handlers. (Note that on this manual page, «calling process» normally corresponds to «parent process». But see the description of CLONE_PARENT below.)

One use of clone() is to implement threads: multiple threads of control in a program that run concurrently in a shared memory space.

А дальше ОС сама разбирается с памятью, т.к. процесс выделяет не физическую память, а виртуальную. И пока процесс не начал менять страницы в памяти они общие (shared) для parent-а и child.

Information

Rating
Does not participate
Registered
Activity