utils: add copy_struct_to_client()

parent c965e801
...@@ -263,4 +263,12 @@ static inline int copy_struct_from_client(__u32 server_size, void *dst, ...@@ -263,4 +263,12 @@ static inline int copy_struct_from_client(__u32 server_size, void *dst,
return 0; return 0;
} }
static inline __u32 copy_struct_to_client(__u32 client_size, void *dst,
__u32 server_size, const void *src)
{
__u32 size = min(server_size, client_size);
memcpy(dst, src, size);
return size;
}
#endif /* __LXC_UTILS_H */ #endif /* __LXC_UTILS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment