| | |
| | | #include "ipc_msg.h" |
| | | #include <string.h> |
| | | #include <stdlib.h> |
| | | #include <sys/types.h> |
| | | #include <sys/stat.h> |
| | | #include <unistd.h> |
| | | #include "ipc_msg.h" |
| | | |
| | | |
| | | int file_exists(char *filename) |
| | | { |
| | | struct stat buffer; |
| | | return (stat (filename, &buffer) == 0); |
| | | } |
| | | /** |
| | | * @brief 发送目标文件描述符 |
| | | * @param fd 传递信息的 UNIX 域 文件描述符 |
| | |
| | | int send_fd_sendmsg(int fd, memfd_data_st** ppmemfd_data) |
| | | { |
| | | memfd_data_st *ptr_memfd_data = *ppmemfd_data; |
| | | return send_fd_args(fd, ptr_memfd_data->memfd, ptr_memfd_data->pid, &ptr_memfd_data->data, ptr_memfd_data->len); |
| | | return send_fd_args_sendmsg(fd, ptr_memfd_data->memfd, ptr_memfd_data->pid, &ptr_memfd_data->data, ptr_memfd_data->len); |
| | | } |
| | | |
| | | /** |
| | |
| | | memset(*ppmemfd_data, 0, control_len); |
| | | memcpy(*ppmemfd_data, CMSG_DATA(&cm), control_len); |
| | | return ret; |
| | | } |
| | | } |