vendredi 31 juillet 2015

Linux - Different threads of a process in different namespaces

I'm looking to open a netlink socket in each existing network namespace to listen for LINK messages associated with interfaces. I'd like to do this from a single process.

According to the 'setns()' documentation - "Given a file descriptor referring to a namespace, reassociate the calling thread with that namespace.". Can I therefore achieve my task by simply using 'pthread_create()' to create a thread for each namespace I require, call 'setns()' and then open the netlink socket.

The reason I ask is because I have seen conflicting information regarding 'setns()' acting on the process namespace.

Aucun commentaire:

Enregistrer un commentaire