@@ -20,14 +20,14 @@ use alloc::{string::String, string::ToString, vec::Vec};
20
20
use cstr_core:: CString ;
21
21
use frida_gum_sys:: GumThreadFlags_GUM_THREAD_FLAGS_ALL ;
22
22
23
- #[ cfg( target_os = "linux" ) ]
23
+ #[ cfg( any ( target_os = "linux" , target_os = "freebsd" ) ) ]
24
24
extern "C" {
25
25
pub fn _frida_g_get_home_dir ( ) -> * const c_char ;
26
26
pub fn _frida_g_get_current_dir ( ) -> * const c_char ;
27
27
pub fn _frida_g_get_tmp_dir ( ) -> * const c_char ;
28
28
}
29
29
30
- #[ cfg( not( target_os = "linux" ) ) ]
30
+ #[ cfg( not( any ( target_os = "linux" , target_os = "freebsd" ) ) ) ]
31
31
extern "C" {
32
32
pub fn g_get_home_dir ( ) -> * const c_char ;
33
33
pub fn g_get_current_dir ( ) -> * const c_char ;
@@ -130,9 +130,9 @@ impl<'a> Process<'a> {
130
130
/// Returns a string specifying the filesystem path to the current working directory
131
131
pub fn current_dir ( & self ) -> String {
132
132
unsafe {
133
- #[ cfg( target_os = "linux" ) ]
133
+ #[ cfg( any ( target_os = "linux" , target_os = "freebsd" ) ) ]
134
134
let dir = _frida_g_get_current_dir ( ) ;
135
- #[ cfg( not( target_os = "linux" ) ) ]
135
+ #[ cfg( not( any ( target_os = "linux" , target_os = "freebsd" ) ) ) ]
136
136
let dir = g_get_current_dir ( ) ;
137
137
138
138
CStr :: from_ptr ( dir) . to_string_lossy ( ) . to_string ( )
@@ -142,9 +142,9 @@ impl<'a> Process<'a> {
142
142
/// Returns a string specifying the filesystem path to the directory to use for temporary files
143
143
pub fn tmp_dir ( & self ) -> String {
144
144
unsafe {
145
- #[ cfg( target_os = "linux" ) ]
145
+ #[ cfg( any ( target_os = "linux" , target_os = "freebsd" ) ) ]
146
146
let dir = _frida_g_get_tmp_dir ( ) ;
147
- #[ cfg( not( target_os = "linux" ) ) ]
147
+ #[ cfg( not( any ( target_os = "linux" , target_os = "freebsd" ) ) ) ]
148
148
let dir = g_get_tmp_dir ( ) ;
149
149
150
150
CStr :: from_ptr ( dir) . to_string_lossy ( ) . to_string ( )
@@ -154,9 +154,9 @@ impl<'a> Process<'a> {
154
154
/// Returns a string specifying the filesystem path to the current user’s home directory
155
155
pub fn home_dir ( & self ) -> String {
156
156
unsafe {
157
- #[ cfg( target_os = "linux" ) ]
157
+ #[ cfg( any ( target_os = "linux" , target_os = "freebsd" ) ) ]
158
158
let dir = _frida_g_get_home_dir ( ) ;
159
- #[ cfg( not( target_os = "linux" ) ) ]
159
+ #[ cfg( not( any ( target_os = "linux" , target_os = "freebsd" ) ) ) ]
160
160
let dir = g_get_home_dir ( ) ;
161
161
162
162
CStr :: from_ptr ( dir) . to_string_lossy ( ) . to_string ( )
0 commit comments