1*5e3eaea3SApple OSS Distributions #ifndef XNU_DARWINTEST_UTILS_H 2*5e3eaea3SApple OSS Distributions #define XNU_DARWINTEST_UTILS_H 3*5e3eaea3SApple OSS Distributions 4*5e3eaea3SApple OSS Distributions #include <stdbool.h> 5*5e3eaea3SApple OSS Distributions 6*5e3eaea3SApple OSS Distributions /* Misc. utility functions for writing darwintests. */ 7*5e3eaea3SApple OSS Distributions bool is_development_kernel(void); 8*5e3eaea3SApple OSS Distributions 9*5e3eaea3SApple OSS Distributions /* Launches the given helper variant as a managed process. */ 10*5e3eaea3SApple OSS Distributions pid_t launch_background_helper( 11*5e3eaea3SApple OSS Distributions const char* variant, 12*5e3eaea3SApple OSS Distributions bool start_suspended, 13*5e3eaea3SApple OSS Distributions bool memorystatus_managed); 14*5e3eaea3SApple OSS Distributions /* 15*5e3eaea3SApple OSS Distributions * Set the process's managed bit, so that the memorystatus subsystem treats 16*5e3eaea3SApple OSS Distributions * this process like an app instead of a sysproc. 17*5e3eaea3SApple OSS Distributions */ 18*5e3eaea3SApple OSS Distributions void set_process_memorystatus_managed(pid_t pid); 19*5e3eaea3SApple OSS Distributions 20*5e3eaea3SApple OSS Distributions #define XNU_T_META_SOC_SPECIFIC T_META_TAG("SoCSpecific") 21*5e3eaea3SApple OSS Distributions 22*5e3eaea3SApple OSS Distributions #define XNU_T_META_REQUIRES_DEVELOPMENT_KERNEL T_META_REQUIRES_SYSCTL_EQ("kern.development", 1) 23*5e3eaea3SApple OSS Distributions #define XNU_T_META_REQUIRES_RELEASE_KERNEL T_META_REQUIRES_SYSCTL_EQ("kern.development", 0) 24*5e3eaea3SApple OSS Distributions 25*5e3eaea3SApple OSS Distributions #endif /* XNU_DARWINTEST_UTILS_H */ 26