Say I have 2 processes, ProcessA and ProcessB. If I perform int fd=open(somefile) in ProcessA, can I then pass the value of file descriptor fd over IPC to ProcessB and have it manipulate the same file?
Say I have 2 processes, ProcessA and ProcessB. If I perform int fd=open(somefile) in
Share
You can pass a file descriptor to another process over unix domain sockets.
Here’s the code to pass such a file descriptor, taken from Unix Network Programming
And here’s the code to receive the file descriptor