Files
runc/libcontainer/nsenter/ipc.h
T
Cory Snider 8f67178139 libct/nsenter: refactor ipc funcs for reusability
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>
2023-07-04 17:56:25 +10:00

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 */