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
Commits
c7e9ec8a
Commit
c7e9ec8a
authored
7 years ago
by
Paul Sajna
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
c7ad4d39
No related branches found
No related tags found
1 merge request
!110
Partial implementation of sys/stat.h
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/sys/types.h
+2
-0
2 additions, 0 deletions
include/sys/types.h
src/platform/src/linux/mod.rs
+2
-2
2 additions, 2 deletions
src/platform/src/linux/mod.rs
src/platform/src/types.rs
+2
-0
2 additions, 0 deletions
src/platform/src/types.rs
src/stat/src/lib.rs
+11
-10
11 additions, 10 deletions
src/stat/src/lib.rs
with
17 additions
and
12 deletions
include/sys/types.h
+
2
−
0
View file @
c7e9ec8a
...
...
@@ -35,6 +35,8 @@ typedef int clockid_t;
typedef
void
*
timer_t
;
typedef
unsigned
long
int
blkcnt_t
;
#ifdef __linux__
#define _SC_PAGE_SIZE 30
#endif
...
...
This diff is collapsed.
Click to expand it.
src/platform/src/linux/mod.rs
+
2
−
2
View file @
c7e9ec8a
...
...
@@ -154,8 +154,8 @@ pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int {
e
(
unsafe
{
syscall!
(
MKDIRAT
,
AT_FDCWD
,
path
,
mode
)
})
as
c_int
}
pub
fn
mkfifo
(
path
:
*
const
c_char
mode
:
mode_t
)
->
c_int
{
e
(
unsafe
{
syscall!
(
MKNODAT
,
AT_FDCWD
,
path
,
mode
,
0
)
})
pub
fn
mkfifo
(
path
:
*
const
c_char
,
mode
:
mode_t
)
->
c_int
{
e
(
unsafe
{
syscall!
(
MKNODAT
,
AT_FDCWD
,
path
,
mode
,
0
)
})
as
c_int
}
pub
fn
nanosleep
(
rqtp
:
*
const
timespec
,
rmtp
:
*
mut
timespec
)
->
c_int
{
...
...
This diff is collapsed.
Click to expand it.
src/platform/src/types.rs
+
2
−
0
View file @
c7e9ec8a
...
...
@@ -59,6 +59,7 @@ pub type dev_t = usize;
pub
type
ino_t
=
usize
;
pub
type
nlink_t
=
usize
;
pub
type
blksize_t
=
isize
;
pub
type
blkcnt_t
=
u64
;
pub
type
useconds_t
=
i32
;
pub
type
suseconds_t
=
i64
;
...
...
@@ -98,4 +99,5 @@ pub struct stat {
pub
st_atim
:
time_t
,
pub
st_mtim
:
time_t
,
pub
st_ctim
:
time_t
,
pub
st_blocks
:
blkcnt_t
,
}
This diff is collapsed.
Click to expand it.
src/stat/src/lib.rs
+
11
−
10
View file @
c7e9ec8a
...
...
@@ -6,13 +6,13 @@ extern crate platform;
use
platform
::
types
::
*
;
pub
const
S_IFMT
:
c_int
=
00170000
;
pub
const
S_IFBLK
:
c_int
=
0060000
;
pub
const
S_IFCHR
:
c_int
=
0020000
;
pub
const
S_IFIFO
:
c_int
=
0010000
;
pub
const
S_IFREG
:
c_int
=
0100000
;
pub
const
S_IFDIR
:
c_int
=
0040000
;
pub
const
S_IFLNK
:
c_int
=
0120000
;
pub
const
S_IFMT
:
c_int
=
00170000
;
pub
const
S_IFBLK
:
c_int
=
0060000
;
pub
const
S_IFCHR
:
c_int
=
0020000
;
pub
const
S_IFIFO
:
c_int
=
0010000
;
pub
const
S_IFREG
:
c_int
=
0100000
;
pub
const
S_IFDIR
:
c_int
=
0040000
;
pub
const
S_IFLNK
:
c_int
=
0120000
;
pub
const
S_IRWXU
:
c_int
=
00700
;
pub
const
S_IRUSR
:
c_int
=
00400
;
...
...
@@ -46,6 +46,7 @@ pub struct stat {
pub
st_atim
:
time_t
,
pub
st_mtim
:
time_t
,
pub
st_ctim
:
time_t
,
pub
st_blocks
:
blkcnt_t
,
}
#[no_mangle]
...
...
@@ -59,12 +60,12 @@ pub extern "C" fn fchmod(fildes: c_int, mode: mode_t) -> c_int {
}
#[no_mangle]
pub
extern
"C"
fn
fstat
(
fildes
:
c_int
,
buf
:
*
mut
stat
)
->
c_int
{
pub
extern
"C"
fn
fstat
(
fildes
:
c_int
,
buf
:
*
mut
platform
::
types
::
stat
)
->
c_int
{
platform
::
fstat
(
fildes
,
buf
)
}
#[no_mangle]
pub
extern
"C"
fn
lstat
(
path
:
*
const
c_char
,
buf
:
*
mut
stat
)
->
c_int
{
pub
extern
"C"
fn
lstat
(
path
:
*
const
c_char
,
buf
:
*
mut
platform
::
types
::
stat
)
->
c_int
{
platform
::
lstat
(
path
,
buf
)
}
...
...
@@ -84,7 +85,7 @@ pub extern "C" fn mknod(path: *const c_char, mode: mode_t, dev: dev_t) -> c_int
}
#[no_mangle]
pub
extern
"C"
fn
stat
(
file
:
*
const
c_char
,
buf
:
*
mut
stat
)
->
c_int
{
pub
extern
"C"
fn
stat
(
file
:
*
const
c_char
,
buf
:
*
mut
platform
::
types
::
stat
)
->
c_int
{
platform
::
stat
(
file
,
buf
)
}
...
...
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