У меня есть проблема с одним из моих проектов.
Я пытаюсь найти хорошо документированный пример использования общей памяти с fork()
, но без успеха.
В основном сценарий заключается в том, что когда пользователь запускает программу, мне нужно сохранить два значения в общей памяти: current_path, который является char * и имя_файла который также является char *.
В зависимости от аргументов команды новый процесс запускается с помощью fork()
, и этот процесс должен читать и изменять переменную current_path, хранящуюся в общей памяти, в то время как имя_файла только для чтения.
Есть ли хороший учебник по общей памяти с примером кода (если возможно), на который вы можете направить меня?
Спасибо, bleepzter