Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
Sortix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
sortix
Sortix
Commits
e2f0f477
Commit
e2f0f477
authored
8 months ago
by
Jonas Termansen
Browse files
Options
Downloads
Patches
Plain Diff
Implement dladdr(3).
parent
8fe25537
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libc/dlfcn/dlfcn.c
+8
-1
8 additions, 1 deletion
libc/dlfcn/dlfcn.c
libc/include/dlfcn.h
+21
-8
21 additions, 8 deletions
libc/include/dlfcn.h
with
29 additions
and
9 deletions
libc/dlfcn/dlfcn.c
+
8
−
1
View file @
e2f0f477
/*
* Copyright (c) 2012, 2013 Jonas 'Sortie' Termansen.
* Copyright (c) 2012, 2013
, 2024
Jonas 'Sortie' Termansen.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
...
...
@@ -22,6 +22,13 @@
static
const
char
*
dlerrormsg
=
NULL
;
int
dladdr
(
const
void
*
restrict
addr
,
Dl_info_t
*
restrict
dlip
)
{
(
void
)
addr
;
(
void
)
dlip
;
return
0
;
}
void
*
dlopen
(
const
char
*
filename
,
int
mode
)
{
(
void
)
filename
;
...
...
This diff is collapsed.
Click to expand it.
libc/include/dlfcn.h
+
21
−
8
View file @
e2f0f477
/*
* Copyright (c) 2012 Jonas 'Sortie' Termansen.
* Copyright (c) 2012
, 2024
Jonas 'Sortie' Termansen.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
...
...
@@ -22,19 +22,32 @@
#include
<sys/cdefs.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#define RTLD_LAZY (1<<0)
#define RTLD_NOW (1<<1)
#define RTLD_GLOBAL (1<<8)
#define RTLD_LOCAL 0
/* Bit 8 is not set. */
int
dlclose
(
void
*
handle
);
#if __USE_SORTIX || 202405L <= __USE_POSIX
typedef
struct
{
const
char
*
dli_fname
;
void
*
dli_fbase
;
const
char
*
dli_sname
;
void
*
dli_saddr
;
}
Dl_info_t
;
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
#if __USE_SORTIX || 202405L <= __USE_POSIX
int
dladdr
(
const
void
*
restrict
,
Dl_info_t
*
__restrict
);
#endif
int
dlclose
(
void
*
);
char
*
dlerror
(
void
);
void
*
dlopen
(
const
char
*
filename
,
int
mode
);
void
*
dlsym
(
void
*
handle
,
const
char
*
name
);
void
*
dlopen
(
const
char
*
,
int
);
void
*
dlsym
(
void
*
,
const
char
*
);
#ifdef __cplusplus
}
/* extern "C" */
...
...
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