mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
8f67178139
Modify receive_fd() and send_fd() so they can be more readily reused in cloned_binary.c. Change receive_fd() to have a single responsibility: receiving and returning a single file descriptor over a UNIX domain socket. Make send_fd() useable in precarious execution contexts such as a clone(CLONE_VFORK|CLONE_VM) "thread" where allocating heap memory or calling exit() would be dangerous. Signed-off-by: Cory Snider <csnider@mirantis.com>
13 lines
298 B
C
13 lines
298 B
C
#ifndef NSENTER_IPC_H
|
|
#define NSENTER_IPC_H
|
|
|
|
int receive_fd(int sockfd);
|
|
|
|
/*
|
|
* send_fd passes the open file descriptor fd to another process via the UNIX
|
|
* domain socket sockfd. The return value of the sendmsg(2) call is returned.
|
|
*/
|
|
int send_fd(int sockfd, int fd);
|
|
|
|
#endif /* NSENTER_IPC_H */
|