Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
relibc
Merge requests
!410
Replace syscall::pipe2 with pipe scheme.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Replace syscall::pipe2 with pipe scheme.
4lDO2/relibc:pipe_scheme
into
master
Overview
0
Commits
1
Pipelines
2
Changes
3
Merged
Jacob Lorentzon
requested to merge
4lDO2/relibc:pipe_scheme
into
master
1 year ago
Overview
0
Commits
1
Pipelines
2
Changes
3
Expand
0
0
Merge request reports
Compare
master
version 1
44d7a33d
1 year ago
master (base)
and
latest version
latest version
9c6bc9ab
1 commit,
1 year ago
version 1
44d7a33d
1 commit,
1 year ago
3 files
+
24
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
src/platform/redox/extra.rs
+
22
−
0
Options
@@ -2,6 +2,8 @@ use core::{ptr, slice};
use
crate
::
platform
::{
sys
::
e
,
types
::
*
};
use
syscall
::{
error
::
*
,
F_SETFD
,
F_SETFL
};
#[no_mangle]
pub
unsafe
extern
"C"
fn
redox_fpath
(
fd
:
c_int
,
buf
:
*
mut
c_void
,
count
:
size_t
)
->
ssize_t
{
e
(
syscall
::
fpath
(
@@ -48,4 +50,24 @@ pub unsafe extern "C" fn redox_physunmap(virtual_address: *mut c_void) -> c_int
e
(
syscall
::
physunmap
(
virtual_address
as
usize
))
as
c_int
}
pub
fn
pipe2
(
fds
:
&
mut
[
c_int
],
flags
:
usize
)
->
syscall
::
error
::
Result
<
()
>
{
let
fds
=
<&
mut
[
c_int
;
2
]
>
::
try_from
(
fds
)
.expect
(
"expected Pal pipe2 to have validated pipe2 array"
);
let
mut
read_fd
=
FdGuard
::
new
(
syscall
::
open
(
"pipe:"
,
flags
)
?
);
let
mut
write_fd
=
FdGuard
::
new
(
syscall
::
dup
(
*
read_fd
,
b"write"
)
?
);
syscall
::
fcntl
(
*
write_fd
,
F_SETFL
,
flags
)
?
;
syscall
::
fcntl
(
*
write_fd
,
F_SETFD
,
flags
)
?
;
*
fds
=
[
c_int
::
try_from
(
*
read_fd
)
.map_err
(|
_
|
Error
::
new
(
EMFILE
))
?
,
c_int
::
try_from
(
*
write_fd
)
.map_err
(|
_
|
Error
::
new
(
EMFILE
))
?
,
];
read_fd
.take
();
write_fd
.take
();
Ok
(())
}
pub
use
redox_exec
::{
create_set_addr_space_buf
,
FdGuard
};
Loading