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
42dce281
Commit
42dce281
authored
4 years ago
by
Lzu Tao
Browse files
Options
Downloads
Patches
Plain Diff
Add dl_iterate_phdr for openbsd
parent
6711eefc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/unix/bsd/netbsdlike/openbsd/mod.rs
+73
-0
73 additions, 0 deletions
src/unix/bsd/netbsdlike/openbsd/mod.rs
with
73 additions
and
0 deletions
src/unix/bsd/netbsdlike/openbsd/mod.rs
+
73
−
0
View file @
42dce281
...
...
@@ -16,6 +16,36 @@ pub type pthread_rwlock_t = *mut ::c_void;
pub
type
pthread_rwlockattr_t
=
*
mut
::
c_void
;
pub
type
caddr_t
=
*
mut
::
c_char
;
// elf.h
pub
type
Elf32_Addr
=
u32
;
pub
type
Elf32_Half
=
u16
;
pub
type
Elf32_Lword
=
u64
;
pub
type
Elf32_Off
=
u32
;
pub
type
Elf32_Sword
=
i32
;
pub
type
Elf32_Word
=
u32
;
pub
type
Elf64_Addr
=
u64
;
pub
type
Elf64_Half
=
u16
;
pub
type
Elf64_Lword
=
u64
;
pub
type
Elf64_Off
=
u64
;
pub
type
Elf64_Sword
=
i32
;
pub
type
Elf64_Sxword
=
i64
;
pub
type
Elf64_Word
=
u32
;
pub
type
Elf64_Xword
=
u64
;
cfg_if!
{
if
#[cfg(target_pointer_width
=
"64"
)]
{
type
Elf_Addr
=
Elf64_Addr
;
type
Elf_Half
=
Elf64_Half
;
type
Elf_Phdr
=
Elf64_Phdr
;
}
else
if
#[cfg(target_pointer_width
=
"32"
)]
{
type
Elf_Addr
=
Elf32_Addr
;
type
Elf_Half
=
Elf32_Half
;
type
Elf_Phdr
=
Elf32_Phdr
;
}
}
s!
{
pub
struct
glob_t
{
pub
gl_pathc
:
::
size_t
,
...
...
@@ -321,6 +351,38 @@ s! {
__shm_ctimensec
:
c_long
,
pub
shm_internal
:
*
mut
::
c_void
,
}
// elf.h
pub
struct
Elf32_Phdr
{
pub
p_type
:
Elf32_Word
,
pub
p_offset
:
Elf32_Off
,
pub
p_vaddr
:
Elf32_Addr
,
pub
p_paddr
:
Elf32_Addr
,
pub
p_filesz
:
Elf32_Word
,
pub
p_memsz
:
Elf32_Word
,
pub
p_flags
:
Elf32_Word
,
pub
p_align
:
Elf32_Word
,
}
pub
struct
Elf64_Phdr
{
pub
p_type
:
Elf64_Word
,
pub
p_flags
:
Elf64_Word
,
pub
p_offset
:
Elf64_Off
,
pub
p_vaddr
:
Elf64_Addr
,
pub
p_paddr
:
Elf64_Addr
,
pub
p_filesz
:
Elf64_Xword
,
pub
p_memsz
:
Elf64_Xword
,
pub
p_align
:
Elf64_Xword
,
}
// link.h
pub
struct
dl_phdr_info
{
pub
dlpi_addr
:
Elf_Addr
,
pub
dlpi_name
:
*
const
::
c_char
,
pub
dlpi_phdr
:
*
const
Elf_Phdr
,
pub
dlpi_phnum
:
Elf_Half
,
}
}
impl
siginfo_t
{
...
...
@@ -1482,6 +1544,17 @@ extern "C" {
needle
:
*
const
::
c_void
,
needlelen
:
::
size_t
,
)
->
*
mut
::
c_void
;
// #include <link.h>
pub
fn
dl_iterate_phdr
(
callback
:
::
Option
<
unsafe
extern
"C"
fn
(
info
:
*
mut
dl_phdr_info
,
size
:
usize
,
data
:
*
mut
::
c_void
,
)
->
::
c_int
,
>
,
data
:
*
mut
::
c_void
,
)
->
::
c_int
;
}
cfg_if!
{
...
...
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