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
716ea87b
Commit
716ea87b
authored
6 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Format
parent
f3a832ad
No related branches found
No related tags found
No related merge requests found
Pipeline
#1317
failed
6 years ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/header/netdb/mod.rs
+7
-6
7 additions, 6 deletions
src/header/netdb/mod.rs
src/header/stdio/helpers.rs
+14
-11
14 additions, 11 deletions
src/header/stdio/helpers.rs
src/header/unistd/mod.rs
+18
-18
18 additions, 18 deletions
src/header/unistd/mod.rs
with
39 additions
and
35 deletions
src/header/netdb/mod.rs
+
7
−
6
View file @
716ea87b
...
@@ -865,23 +865,24 @@ pub unsafe extern "C" fn getservent() -> *const servent {
...
@@ -865,23 +865,24 @@ pub unsafe extern "C" fn getservent() -> *const servent {
let
mut
iter
=
r
.split_whitespace
();
let
mut
iter
=
r
.split_whitespace
();
let
mut
serv_name
=
match
iter
.next
()
{
let
mut
serv_name
=
match
iter
.next
()
{
Some
(
serv_name
)
=>
serv_name
.as_bytes
()
.to_vec
(),
Some
(
serv_name
)
=>
serv_name
.as_bytes
()
.to_vec
(),
None
=>
continue
None
=>
continue
,
};
};
serv_name
.push
(
b'\0'
);
serv_name
.push
(
b'\0'
);
let
port_proto
=
match
iter
.next
()
{
let
port_proto
=
match
iter
.next
()
{
Some
(
port_proto
)
=>
port_proto
,
Some
(
port_proto
)
=>
port_proto
,
None
=>
continue
None
=>
continue
,
};
};
let
mut
split
=
port_proto
.split
(
"/"
);
let
mut
split
=
port_proto
.split
(
"/"
);
let
mut
port
=
match
split
.next
()
{
let
mut
port
=
match
split
.next
()
{
Some
(
port
)
=>
port
.as_bytes
()
.to_vec
(),
Some
(
port
)
=>
port
.as_bytes
()
.to_vec
(),
None
=>
continue
None
=>
continue
,
};
};
port
.push
(
b'\0'
);
port
.push
(
b'\0'
);
SERV_PORT
=
Some
(
htons
(
atoi
(
port
.as_mut_slice
()
.as_mut_ptr
()
as
*
mut
i8
)
as
u16
)
as
u32
as
i32
);
SERV_PORT
=
Some
(
htons
(
atoi
(
port
.as_mut_slice
()
.as_mut_ptr
()
as
*
mut
i8
)
as
u16
)
as
u32
as
i32
);
let
mut
proto
=
match
split
.next
()
{
let
mut
proto
=
match
split
.next
()
{
Some
(
proto
)
=>
proto
.as_bytes
()
.to_vec
(),
Some
(
proto
)
=>
proto
.as_bytes
()
.to_vec
(),
None
=>
continue
None
=>
continue
,
};
};
proto
.push
(
b'\0'
);
proto
.push
(
b'\0'
);
...
@@ -922,7 +923,7 @@ pub unsafe extern "C" fn getservent() -> *const servent {
...
@@ -922,7 +923,7 @@ pub unsafe extern "C" fn getservent() -> *const servent {
if
SERV_STAYOPEN
==
0
{
if
SERV_STAYOPEN
==
0
{
endservent
();
endservent
();
}
}
break
&
SERV_ENTRY
as
*
const
servent
break
&
SERV_ENTRY
as
*
const
servent
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/header/stdio/helpers.rs
+
14
−
11
View file @
716ea87b
use
core
::{
mem
,
ptr
};
use
core
::
sync
::
atomic
::
AtomicBool
;
use
core
::
sync
::
atomic
::
AtomicBool
;
use
core
::{
mem
,
ptr
};
use
header
::
errno
;
use
header
::
errno
;
use
header
::
fcntl
::
*
;
use
header
::
fcntl
::
*
;
...
@@ -67,16 +67,19 @@ pub unsafe fn _fdopen(fd: c_int, mode: *const c_char) -> Option<*mut FILE> {
...
@@ -67,16 +67,19 @@ pub unsafe fn _fdopen(fd: c_int, mode: *const c_char) -> Option<*mut FILE> {
if
f
.is_null
()
{
if
f
.is_null
()
{
None
None
}
else
{
}
else
{
ptr
::
write
(
f
,
FILE
{
ptr
::
write
(
flags
:
flags
,
f
,
read
:
None
,
FILE
{
write
:
None
,
flags
:
flags
,
fd
:
fd
,
read
:
None
,
buf
:
vec!
[
0u8
;
BUFSIZ
+
UNGET
],
write
:
None
,
buf_char
:
-
1
,
fd
:
fd
,
unget
:
UNGET
,
buf
:
vec!
[
0u8
;
BUFSIZ
+
UNGET
],
lock
:
AtomicBool
::
new
(
false
)
buf_char
:
-
1
,
});
unget
:
UNGET
,
lock
:
AtomicBool
::
new
(
false
),
},
);
Some
(
f
)
Some
(
f
)
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/header/unistd/mod.rs
+
18
−
18
View file @
716ea87b
...
@@ -50,24 +50,24 @@ pub extern "C" fn access(path: *const c_char, mode: c_int) -> c_int {
...
@@ -50,24 +50,24 @@ pub extern "C" fn access(path: *const c_char, mode: c_int) -> c_int {
#[no_mangle]
#[no_mangle]
pub
extern
"C"
fn
alarm
(
seconds
:
c_uint
)
->
c_uint
{
pub
extern
"C"
fn
alarm
(
seconds
:
c_uint
)
->
c_uint
{
// let mut timer = sys_time::itimerval {
// let mut timer = sys_time::itimerval {
// it_value: sys_time::timeval {
// it_value: sys_time::timeval {
// tv_sec: seconds as time_t,
// tv_sec: seconds as time_t,
// tv_usec: 0,
// tv_usec: 0,
// },
// },
// ..Default::default()
// ..Default::default()
// };
// };
// let errno_backup = unsafe { platform::errno };
// let errno_backup = unsafe { platform::errno };
// let secs = if sys_time::setitimer(sys_time::ITIMER_REAL, &timer, &mut timer) < 0 {
// let secs = if sys_time::setitimer(sys_time::ITIMER_REAL, &timer, &mut timer) < 0 {
// 0
// 0
// } else {
// } else {
// timer.it_value.tv_sec as c_uint + if timer.it_value.tv_usec > 0 { 1 } else { 0 }
// timer.it_value.tv_sec as c_uint + if timer.it_value.tv_usec > 0 { 1 } else { 0 }
// };
// };
// unsafe {
// unsafe {
// platform::errno = errno_backup;
// platform::errno = errno_backup;
// }
// }
//
//
// secs
// secs
0
0
}
}
...
...
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