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
Peter Limkilde Svendsen
relibc
Commits
bc0763f3
Commit
bc0763f3
authored
7 years ago
by
Paul Sajna
Browse files
Options
Downloads
Patches
Plain Diff
fmt
parent
14957bb8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/platform/src/redox/mod.rs
+23
-23
23 additions, 23 deletions
src/platform/src/redox/mod.rs
with
23 additions
and
23 deletions
src/platform/src/redox/mod.rs
+
23
−
23
View file @
bc0763f3
...
...
@@ -47,9 +47,9 @@ pub fn chown(path: *const c_char, owner: uid_t, group: gid_t) -> c_int {
match
syscall
::
open
(
path
,
O_WRONLY
)
{
Err
(
err
)
=>
e
(
Err
(
err
))
as
c_int
,
Ok
(
fd
)
=>
{
let
res
=
syscall
::
fchown
(
fd
as
usize
,
owner
as
u32
,
group
as
u32
);
let
_
=
syscall
::
close
(
fd
);
e
(
res
)
as
c_int
let
res
=
syscall
::
fchown
(
fd
as
usize
,
owner
as
u32
,
group
as
u32
);
let
_
=
syscall
::
close
(
fd
);
e
(
res
)
as
c_int
}
}
}
...
...
@@ -97,28 +97,28 @@ pub fn fork() -> pid_t {
}
pub
fn
fstat
(
fildes
:
c_int
,
buf
:
*
mut
stat
)
->
c_int
{
let
mut
redox_buf
:
redox_stat
=
redox_stat
::
default
();
let
mut
redox_buf
:
redox_stat
=
redox_stat
::
default
();
match
e
(
syscall
::
fstat
(
fildes
as
usize
,
&
mut
redox_buf
))
{
0
=>
{
unsafe
{
if
!
buf
.is_null
()
{
(
*
buf
)
.st_dev
=
redox_buf
.st_dev
as
dev_t
;
(
*
buf
)
.st_ino
=
redox_buf
.st_ino
as
ino_t
;
(
*
buf
)
.st_nlink
=
redox_buf
.st_nlink
as
nlink_t
;
(
*
buf
)
.st_mode
=
redox_buf
.st_mode
;
(
*
buf
)
.st_uid
=
redox_buf
.st_uid
as
uid_t
;
(
*
buf
)
.st_gid
=
redox_buf
.st_gid
as
gid_t
;
// TODO st_rdev
(
*
buf
)
.st_rdev
=
0
;
(
*
buf
)
.st_size
=
redox_buf
.st_size
as
off_t
;
(
*
buf
)
.st_blksize
=
redox_buf
.st_blksize
as
blksize_t
;
(
*
buf
)
.st_atim
=
redox_buf
.st_atime
as
time_t
;
(
*
buf
)
.st_mtim
=
redox_buf
.st_mtime
as
time_t
;
(
*
buf
)
.st_ctim
=
redox_buf
.st_ctime
as
time_t
;
}
0
=>
{
unsafe
{
if
!
buf
.is_null
()
{
(
*
buf
)
.st_dev
=
redox_buf
.st_dev
as
dev_t
;
(
*
buf
)
.st_ino
=
redox_buf
.st_ino
as
ino_t
;
(
*
buf
)
.st_nlink
=
redox_buf
.st_nlink
as
nlink_t
;
(
*
buf
)
.st_mode
=
redox_buf
.st_mode
;
(
*
buf
)
.st_uid
=
redox_buf
.st_uid
as
uid_t
;
(
*
buf
)
.st_gid
=
redox_buf
.st_gid
as
gid_t
;
// TODO st_rdev
(
*
buf
)
.st_rdev
=
0
;
(
*
buf
)
.st_size
=
redox_buf
.st_size
as
off_t
;
(
*
buf
)
.st_blksize
=
redox_buf
.st_blksize
as
blksize_t
;
(
*
buf
)
.st_atim
=
redox_buf
.st_atime
as
time_t
;
(
*
buf
)
.st_mtim
=
redox_buf
.st_mtime
as
time_t
;
(
*
buf
)
.st_ctim
=
redox_buf
.st_ctime
as
time_t
;
}
0
},
}
0
}
_
=>
-
1
,
}
}
...
...
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