遇见YY

导航

 
#include <strings.h>
#include <unistd.h>
#include <stdio.h>
int main(){
    char host__name[32] = {0};
    bzero(host__name,32);
    char domainname[32] = {0};
    bzero(domainname,32);
    int h = gethostname  (host__name,32);
    int d = getdomainname(domainname,32);
    if (!h){
        printf("host__name:%s\n",host__name);

    }
    if (!d){
        printf("domainname:%s\n",domainname);
    }
}

 

posted on 2020-08-10 20:12  一骑红尘妃子笑!  阅读(292)  评论(0编辑  收藏  举报