Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
0db97911
Unverified
Commit
0db97911
authored
Feb 25, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: add lxc_cmd_init() and lxc_cmd_data()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
f5e3cb95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
commands.h
src/lxc/commands.h
+17
-0
No files found.
src/lxc/commands.h
View file @
0db97911
...
...
@@ -3,6 +3,7 @@
#ifndef __LXC_COMMANDS_H
#define __LXC_COMMANDS_H
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
...
...
@@ -56,6 +57,8 @@ struct lxc_cmd_req {
const
void
*
data
;
};
#define ENCODE_INTO_PTR_LEN 0
struct
lxc_cmd_rsp
{
int
ret
;
/* 0 on success, -errno on failure */
int
datalen
;
...
...
@@ -67,6 +70,20 @@ struct lxc_cmd_rr {
struct
lxc_cmd_rsp
rsp
;
};
static
inline
void
lxc_cmd_init
(
struct
lxc_cmd_rr
*
cmd
,
lxc_cmd_t
command
)
{
*
cmd
=
(
struct
lxc_cmd_rr
){
.
req
=
{.
cmd
=
command
},
.
rsp
=
{.
ret
=
-
ENOSYS
},
};
}
static
inline
void
lxc_cmd_data
(
struct
lxc_cmd_rr
*
cmd
,
int
len_data
,
const
void
*
data
)
{
cmd
->
req
.
data
=
data
;
cmd
->
req
.
datalen
=
len_data
;
}
struct
lxc_cmd_tty_rsp_data
{
int
ptxfd
;
int
ttynum
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment