Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
dee3c3e7
Commit
dee3c3e7
authored
Mar 02, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround seccomp on MagiskBoot
Close #1150
parent
d8cd2031
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
file.cpp
native/jni/utils/file.cpp
+7
-3
No files found.
native/jni/utils/file.cpp
View file @
dee3c3e7
...
...
@@ -358,9 +358,13 @@ void full_read_at(int dirfd, const char *filename, void **buf, size_t *size) {
}
void
write_zero
(
int
fd
,
size_t
size
)
{
size_t
pos
=
lseek
(
fd
,
0
,
SEEK_CUR
);
ftruncate
(
fd
,
pos
+
size
);
lseek
(
fd
,
pos
+
size
,
SEEK_SET
);
char
buf
[
4096
]
=
{
0
};
size_t
len
;
while
(
size
>
0
)
{
len
=
sizeof
(
buf
)
>
size
?
size
:
sizeof
(
buf
);
write
(
fd
,
buf
,
len
);
size
-=
len
;
}
}
void
file_readline
(
const
char
*
filename
,
const
function
<
bool
(
string_view
&
)
>
&
fn
,
bool
trim
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment