EB
Size: a a a
EB
EB
MG
М
М
М
M
EB
MG
MG
EB
MG
MG
// assume fd is 2 bytesgiven https://del.dog/yesixowipo.cc is used to send and receive the fd
int total = 0;
// do not modify the original message
if (total > 0) {
struct msghdr msg = {0};
memcpy(&msg, __msg, sizeof(*__msg));
msg.msg_control = static_cast<void *>(static_cast<uint8_t *>(__msg->msg_control) +
total);
msg.msg_controllen -= total;
*ret = sendmsg(socket_data_fd, &msg, flags);
} else *ret = sendmsg(socket_data_fd, __msg, flags);
total = 1;
if (total > 0) {
struct msghdr msg = {0};
memcpy(&msg, __msg, sizeof(*__msg));
msg.msg_control = static_cast<void *>(static_cast<uint8_t *>(__msg->msg_control) +
total);
msg.msg_controllen -= total;
*ret = sendmsg(socket_data_fd, &msg, flags);
} else *ret = sendmsg(socket_data_fd, __msg, flags);
FN
FN
FN
FN
I
MG
/dev/ashmem
) and how would i use it safely