AppleOpenSource/dyld-750.6/dyld3/BootArgs.cpp
/*
* Checks to see if there are any args that impact dyld. These args
* can be set sevaral ways. These will only be honored on development
* and Apple Internal builds.
*/
Checks to see if there are any args that impact dyld. These args
can be set sevaral ways. These will only be honored on development
and Apple Internal builds.
Checks to see if there are any args that impact dyld . These args can be set sevaral ways . These will only be honored on development and Apple Internal builds .
bool BootArgs::contains(const char* arg)
{
#if TARGET_OS_SIMULATOR
    return false;
#else
    if ( !internalInstall() )
        return false;
    size_t len;
    if ( sysctlbyname("kern.bootargs", NULL, &len, NULL, 0) != 0 )
        return false;
    char bootArgsBuffer[len];
    if ( sysctlbyname("kern.bootargs", bootArgsBuffer, &len, NULL, 0) != 0 )
        return false;
    return (strstr(bootArgsBuffer, arg) != nullptr);
#endif
}
bool BootArgs :: contains ( const char * arg ) { #if TARGET_OS_SIMULATOR return false ; #else if ( ! internalInstall ( ) ) return false ; size_t len ; if ( sysctlbyname ( " " , NULL , & len , NULL , 0 ) != 0 ) return false ; char bootArgsBuffer [ len ] ; if ( sysctlbyname ( " " , bootArgsBuffer , & len , NULL , 0 ) != 0 ) return false ; return ( strstr ( bootArgsBuffer , arg ) != nullptr ) ; #endif }
Checks to see if there are any args that impact dyld.
Checks to see if there are any args that impact dyld .
//FIXME: Use strnstr(). Unfortunately we are missing an imp in libc.a // don't check for boot-args on customer installs // get length of full boot-args string // get copy of boot-args string // return true if 'arg' is a sub-string of boot-args