Skip to content

Commit

Permalink
utils: add copy_struct_to_client()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent aa659ba commit 89b2bfa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lxc/utils.h
Expand Up @@ -261,4 +261,12 @@ static inline int copy_struct_from_client(__u32 server_size, void *dst,
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 */

0 comments on commit 89b2bfa

Please sign in to comment.