linux hostid 변경하기
#include <stdio.h>
#include <unistd.h>
int main() {
long id,res;
// get real (default) hostid
id = gethostid();
printf(“current hostid is: %x\\n”,id);
// set new hostid if is superuser
res = sethostid(0x007f0100);
if (res == 0) printf(“if result is zero – success! (%d) \\n”,res);
// check if it is changed….
id = gethostid();
printf(“current hostid is: %x ;-PPPppppp\\n”,id);
}