-
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
payload: Ensure dup3() is declared on Linux
Older libc versions don't have it. Co-authored-by: Håvard Sørbø <[email protected]>
- Loading branch information
Showing
4 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef __FRIDA_LIBC_SHIM_H__ | ||
#define __FRIDA_LIBC_SHIM_H__ | ||
|
||
#ifdef HAVE_LINUX | ||
int dup3 (int oldfd, int newfd, int flags); | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[CCode (cheader_filename = "libc-shim.h", lower_case_cprefix = "", gir_namespace = "FridaLibcShim", gir_version = "1.0")] | ||
namespace Frida.LibcShim { | ||
#if LINUX | ||
public int dup3 (int oldfd, int newfd, int flags); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,13 @@ payload_vala_args = gum_vala_args + gumjs_vala_args | |
|
||
payload = static_library('frida-payload-' + api_version, payload_sources, | ||
c_args: frida_component_cflags, | ||
vala_args: [payload_vala_args, base_vala_args, extra_vala_args], | ||
vala_args: [ | ||
'--vapidir=' + meson.current_source_dir(), | ||
'--pkg=libc-shim', | ||
payload_vala_args, | ||
base_vala_args, | ||
extra_vala_args, | ||
], | ||
vala_header: 'frida-payload.h', | ||
vala_vapi: f'frida-payload-@[email protected]', | ||
dependencies: [gio_dep, gee_dep, json_glib_dep, gum_dep, gumjs_dep, base_dep], | ||
|