Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
d977b176
Commit
d977b176
authored
7 years ago
by
Vivek Das Mohapatra
Browse files
Options
Downloads
Patches
Plain Diff
The _t suffix is reserved for libc &co (by convention)
parent
4eb97d54
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!311
Build capsule-capture-libs from a bundled copy of libcapsule
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
utils/mmap-info.c
+9
-9
9 additions, 9 deletions
utils/mmap-info.c
utils/mmap-info.h
+7
-7
7 additions, 7 deletions
utils/mmap-info.h
utils/process-pt-dynamic.h
+1
-1
1 addition, 1 deletion
utils/process-pt-dynamic.h
with
17 additions
and
17 deletions
utils/mmap-info.c
+
9
−
9
View file @
d977b176
...
...
@@ -49,14 +49,14 @@ typedef enum
return NULL; })
void
free_mmap_info
(
mmapinfo
_t
*
ptr
)
free_mmap_info
(
mmapinfo
*
ptr
)
{
if
(
ptr
)
free
(
ptr
);
}
mmapinfo
_t
*
find_mmap_info
(
mmapinfo
_t
*
maps
,
void
*
addr
)
mmapinfo
*
find_mmap_info
(
mmapinfo
*
maps
,
void
*
addr
)
{
if
(
!
maps
)
return
NULL
;
...
...
@@ -76,7 +76,7 @@ find_mmap_info(mmapinfo_t *maps, void *addr)
}
int
add_mmap_protection
(
mmapinfo
_t
*
mmap_info
,
unsigned
int
flags
)
add_mmap_protection
(
mmapinfo
*
mmap_info
,
unsigned
int
flags
)
{
ElfW
(
Addr
)
start
=
(
ElfW
(
Addr
))
mmap_info
->
start
;
ElfW
(
Addr
)
end
=
(
ElfW
(
Addr
))
mmap_info
->
end
;
...
...
@@ -87,7 +87,7 @@ add_mmap_protection(mmapinfo_t *mmap_info, unsigned int flags)
}
int
reset_mmap_protection
(
mmapinfo
_t
*
mmap_info
)
reset_mmap_protection
(
mmapinfo
*
mmap_info
)
{
ElfW
(
Addr
)
start
=
(
ElfW
(
Addr
))
mmap_info
->
start
;
ElfW
(
Addr
)
end
=
(
ElfW
(
Addr
))
mmap_info
->
end
;
...
...
@@ -96,13 +96,13 @@ reset_mmap_protection(mmapinfo_t *mmap_info)
return
mprotect
(
(
void
*
)
start
,
size
,
mmap_info
->
protect
);
}
mmapinfo
_t
*
mmapinfo
*
load_mmap_info
(
int
*
err
,
const
char
**
errstr
)
{
FILE
*
maps
=
fopen
(
PROC_FILE
,
"r"
);
char
map_line
[
80
+
PATH_MAX
];
int
map_entries
=
0
;
mmapinfo
_t
*
entries
=
NULL
;
mmapinfo
*
entries
=
NULL
;
if
(
!
maps
)
ERROR
(
"Warning: could not open "
PROC_FILE
);
...
...
@@ -114,7 +114,7 @@ load_mmap_info (int *err, const char **errstr)
ERROR
(
"Warning: Unable to seek to start of "
PROC_FILE
);
if
(
map_entries
>
0
)
entries
=
calloc
(
map_entries
+
1
,
sizeof
(
mmapinfo
_t
)
);
entries
=
calloc
(
map_entries
+
1
,
sizeof
(
mmapinfo
)
);
else
ERROR
(
"Warning: no mmap entries found in "
PROC_FILE
);
...
...
@@ -244,7 +244,7 @@ load_mmap_info (int *err, const char **errstr)
}
int
mmap_entry_should_be_writable
(
mmapinfo
_t
*
mmap_info
)
mmap_entry_should_be_writable
(
mmapinfo
*
mmap_info
)
{
// malformed or unparseable entry - cannot handle:
if
(
mmap_info
->
invalid
)
...
...
This diff is collapsed.
Click to expand it.
utils/mmap-info.h
+
7
−
7
View file @
d977b176
...
...
@@ -27,14 +27,14 @@ typedef struct
char
*
end
;
unsigned
int
protect
;
int
invalid
;
}
mmapinfo
_t
;
}
mmapinfo
;
mmapinfo
_t
*
load_mmap_info
(
int
*
err
,
const
char
**
errstr
);
mmapinfo
_t
*
find_mmap_info
(
mmapinfo
_t
*
maps
,
void
*
addr
);
void
free_mmap_info
(
mmapinfo
_t
*
ptr
);
mmapinfo
*
load_mmap_info
(
int
*
err
,
const
char
**
errstr
);
mmapinfo
*
find_mmap_info
(
mmapinfo
*
maps
,
void
*
addr
);
void
free_mmap_info
(
mmapinfo
*
ptr
);
int
add_mmap_protection
(
mmapinfo
_t
*
mmap_info
,
unsigned
int
flags
);
int
reset_mmap_protection
(
mmapinfo
_t
*
mmap_info
);
int
add_mmap_protection
(
mmapinfo
*
mmap_info
,
unsigned
int
flags
);
int
reset_mmap_protection
(
mmapinfo
*
mmap_info
);
int
mmap_entry_should_be_writable
(
mmapinfo
_t
*
mmap_info
);
int
mmap_entry_should_be_writable
(
mmapinfo
*
mmap_info
);
This diff is collapsed.
Click to expand it.
utils/process-pt-dynamic.h
+
1
−
1
View file @
d977b176
...
...
@@ -35,7 +35,7 @@ typedef struct
struct
{
int
success
;
int
failure
;
}
count
;
int
debug
;
char
*
error
;
mmapinfo
_t
*
mmap_info
;
mmapinfo
*
mmap_info
;
}
relocation_data_t
;
typedef
int
(
*
relocate_cb_t
)(
const
void
*
start
,
...
...
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