Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tansiv
TANSIV
Commits
d7b62c2a
Commit
d7b62c2a
authored
Apr 16, 2020
by
RILLING Louis
Browse files
fake-vm/capi: Document vsg_send()
parent
29f7b243
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/fake-vm/capi/src/lib.rs
View file @
d7b62c2a
...
...
@@ -108,6 +108,23 @@ pub unsafe extern fn vsg_gettimeofday(context: *const Context, timeval: *mut lib
}
}
/// Sends a message having source address `src`, destination address `dest` and a payload stored in
/// `msg[0..msglen]`.
///
/// # Safety
///
/// * `context` should point to a valid context, as previously returned by [`vsg_init`].
///
/// * If `msglen` is `0`, it is allowed that `msg` is `NULL`.
///
/// # Error codes
///
/// * Fails with `libc::EINVAL` whenever context is `NULL` or `msg` is `NULL` with `msglen > 0`.
///
/// * Fails with `libc::EMSGSIZE` whenever the payload is bigger than the maximum message size that
/// vsg can handle.
///
/// * Fails with `libc::ENOMEM` whenever there is no more buffers to hold the message to send.
#[no_mangle]
pub
unsafe
extern
fn
vsg_send
(
context
:
*
const
Context
,
src
:
VsgAddress
,
dest
:
VsgAddress
,
msglen
:
u32
,
msg
:
*
const
u8
)
->
c_int
{
if
let
Some
(
context
)
=
context
.as_ref
()
{
...
...
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