Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libc
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
libc
Commits
be35992b
Commit
be35992b
authored
6 years ago
by
Stefan Lankes
Browse files
Options
Downloads
Patches
Plain Diff
add missing debug trait for sockaddr_storage
parent
cab10b47
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/unix/hermit/mod.rs
+43
-3
43 additions, 3 deletions
src/unix/hermit/mod.rs
with
43 additions
and
3 deletions
src/unix/hermit/mod.rs
+
43
−
3
View file @
be35992b
...
...
@@ -52,20 +52,20 @@ pub type pthread_rwlock_t = usize;
pub
type
pthread_rwlockattr_t
=
usize
;
s_no_extra_traits!
{
pub
struct
dirent
{
pub
struct
dirent
{
pub
d_ino
:
::
c_long
,
pub
d_off
:
off_t
,
pub
d_reclen
:
u16
,
pub
d_name
:
[::
c_char
;
256
],
}
// Dummy
// Dummy
pub
struct
sockaddr_un
{
pub
sun_family
:
sa_family_t
,
pub
sun_path
:
[::
c_char
;
108
],
}
pub
struct
sockaddr
{
pub
struct
sockaddr
{
pub
sa_len
:
u8
,
pub
sa_family
:
sa_family_t
,
pub
sa_data
:
[::
c_char
;
14
],
...
...
@@ -258,6 +258,46 @@ cfg_if! {
}
}
impl
PartialEq
for
sockaddr_storage
{
fn
eq
(
&
self
,
other
:
&
sockaddr_storage
)
->
bool
{
self
.s2_len
==
other
.s2_len
&&
self
.ss_family
==
other
.ss_family
&&
self
.s2_data1
.iter
()
.zip
(
other
.s2_data1
.iter
())
.all
(|(
a
,
b
)|
a
==
b
)
&&
self
.s2_data2
.iter
()
.zip
(
other
.s2_data2
.iter
())
.all
(|(
a
,
b
)|
a
==
b
)
&&
self
.s2_data3
.iter
()
.zip
(
other
.s2_data3
.iter
())
.all
(|(
a
,
b
)|
a
==
b
)
}
}
impl
Eq
for
sockaddr_storage
{}
impl
::
fmt
::
Debug
for
sockaddr_storage
{
fn
fmt
(
&
self
,
f
:
&
mut
::
fmt
::
Formatter
)
->
::
fmt
::
Result
{
f
.debug_struct
(
"sockaddr_storage"
)
.field
(
"s2_len"
,
&
self
.s2_len
)
.field
(
"ss_family"
,
&
self
.ss_family
)
// FIXME: .field("s2_data1", &self.s2_data1)
// FIXME: .field("s2_data2", &self.s2_data2)
// FIXME: .field("s2_data3", &self.s2_data3)
.finish
()
}
}
impl
::
hash
::
Hash
for
sockaddr_storage
{
fn
hash
<
H
:
::
hash
::
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
self
.s2_len
.hash
(
state
);
self
.ss_family
.hash
(
state
);
self
.s2_data1
.hash
(
state
);
self
.s2_data2
.hash
(
state
);
self
.s2_data3
.hash
(
state
);
}
}
impl
PartialEq
for
stat
{
fn
eq
(
&
self
,
other
:
&
stat
)
->
bool
{
self
.st_dev
==
other
.st_dev
...
...
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