Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
getrandom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
getrandom
Commits
190c0bcb
Commit
190c0bcb
authored
4 years ago
by
felixmoebius
Browse files
Options
Downloads
Patches
Plain Diff
Add support for target_os = "unikraft"
parent
c29dd5f8
Branches
master
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/lib.rs
+1
-1
1 addition, 1 deletion
src/lib.rs
src/use_file.rs
+1
-1
1 addition, 1 deletion
src/use_file.rs
src/util_libc.rs
+1
-1
1 addition, 1 deletion
src/util_libc.rs
with
3 additions
and
3 deletions
src/lib.rs
+
1
−
1
View file @
190c0bcb
...
@@ -175,7 +175,7 @@ cfg_if! {
...
@@ -175,7 +175,7 @@ cfg_if! {
target_os
=
"haiku"
,
target_os
=
"redox"
))]
{
target_os
=
"haiku"
,
target_os
=
"redox"
))]
{
mod
util_libc
;
mod
util_libc
;
#[path
=
"use_file.rs"
]
mod
imp
;
#[path
=
"use_file.rs"
]
mod
imp
;
}
else
if
#[cfg(any(target_os
=
"android"
,
target_os
=
"linux"
))]
{
}
else
if
#[cfg(any(target_os
=
"android"
,
target_os
=
"linux"
,
target_os
=
"unikraft"
))]
{
mod
util_libc
;
mod
util_libc
;
mod
use_file
;
mod
use_file
;
#[path
=
"linux_android.rs"
]
mod
imp
;
#[path
=
"linux_android.rs"
]
mod
imp
;
...
...
This diff is collapsed.
Click to expand it.
src/use_file.rs
+
1
−
1
View file @
190c0bcb
...
@@ -28,7 +28,7 @@ const FILE_PATH: &str = "rand:\0";
...
@@ -28,7 +28,7 @@ const FILE_PATH: &str = "rand:\0";
target_os
=
"illumos"
target_os
=
"illumos"
))]
))]
const
FILE_PATH
:
&
str
=
"/dev/random
\0
"
;
const
FILE_PATH
:
&
str
=
"/dev/random
\0
"
;
#[cfg(any(target_os
=
"android"
,
target_os
=
"linux"
))]
#[cfg(any(target_os
=
"android"
,
target_os
=
"linux"
,
target_os
=
"unikraft"
))]
const
FILE_PATH
:
&
str
=
"/dev/urandom
\0
"
;
const
FILE_PATH
:
&
str
=
"/dev/urandom
\0
"
;
pub
fn
getrandom_inner
(
dest
:
&
mut
[
u8
])
->
Result
<
(),
Error
>
{
pub
fn
getrandom_inner
(
dest
:
&
mut
[
u8
])
->
Result
<
(),
Error
>
{
...
...
This diff is collapsed.
Click to expand it.
src/util_libc.rs
+
1
−
1
View file @
190c0bcb
...
@@ -12,7 +12,7 @@ use core::{num::NonZeroU32, ptr::NonNull};
...
@@ -12,7 +12,7 @@ use core::{num::NonZeroU32, ptr::NonNull};
cfg_if!
{
cfg_if!
{
if
#[cfg(any(target_os
=
"netbsd"
,
target_os
=
"openbsd"
,
target_os
=
"android"
))]
{
if
#[cfg(any(target_os
=
"netbsd"
,
target_os
=
"openbsd"
,
target_os
=
"android"
))]
{
use
libc
::
__errno
as
errno_location
;
use
libc
::
__errno
as
errno_location
;
}
else
if
#[cfg(any(target_os
=
"linux"
,
target_os
=
"emscripten"
,
target_os
=
"redox"
))]
{
}
else
if
#[cfg(any(target_os
=
"linux"
,
target_os
=
"emscripten"
,
target_os
=
"redox"
,
target_os
=
"unikraft"
))]
{
use
libc
::
__errno_location
as
errno_location
;
use
libc
::
__errno_location
as
errno_location
;
}
else
if
#[cfg(any(target_os
=
"solaris"
,
target_os
=
"illumos"
))]
{
}
else
if
#[cfg(any(target_os
=
"solaris"
,
target_os
=
"illumos"
))]
{
use
libc
::
___errno
as
errno_location
;
use
libc
::
___errno
as
errno_location
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment