Try to search your question here, if you can't find : Ask Any Question Now ?

error: ‘mlogf’ was not declared in this scope

HomeCategory: stackoverflowerror: ‘mlogf’ was not declared in this scope
Avatarcraig asked 4 months ago

i got this error on compiling with g++ version 8.2.0
same code i am able to compile with gcc version 8.2.0

I searched on internet for mlogf function but nothing found about.
Please someone with experience can light me what is wrong and where is this function ?

Regards.

void *dns_child_thread(struct host_data *host)
{
    unsigned int newip;

    pthread_mutex_lock(&prg.lockdns);
    newip = hostname2ip(host->name);
    pthread_mutex_unlock(&prg.lockdns);
    usleep(10000);
    if (!newip) {
        mlogf(LOGDEBUG,0," dns: failed to get address for %sn",host->name);
        host->checkiptime = getseconds() + 60;
        host->ip = newip;
    }
    else if (newip!=host->ip) {
        host->checkiptime = getseconds() + 300;
        host->ip = newip;
        mlogf(LOGDEBUG,0," dns: %s --> %sn", host->name, ip2string(host->ip));
    }
    else {
        host->checkiptime = getseconds() + 600;
        mlogf(LOGDEBUG,0," dns: %s == %sn", host->name, ip2string(host->ip));
    }
    return NULL;
}

void *dns_thread(void *param)
{
#ifndef PUBLIC
    prg.pid_dns = syscall(SYS_gettid);
    //prg.tid_dns = pthread_self();
    prctl(PR_SET_NAME,"Lookup",0,0,0);
#endif
    do {
        pthread_mutex_lock(&prg.lockdnsth);

        struct host_data *host = cfg.host;
        while (host) {
            if (host->checkiptime<=getseconds()) {
                //pthread_t new_tid;
                //create_thread(&new_tid, (threadfn)dns_child_thread,host);
                dns_child_thread( host );
            }
            host = host->next;
        }

        pthread_mutex_unlock(&prg.lockdnsth);
        sleep(10);
    } while (1);
    return NULL;
}


int start_thread_dns()
{
    create_thread(&prg.tid_dns, (threadfn)dns_thread,NULL);
    return 0;
}
1 Answers
Best Answer
AvatarJyoti answered 4 months ago
Your Answer

17 + 20 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com