sethostname doesn't make permanet the hostname

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

sethostname doesn't make permanet the hostname

1,305 次查看
Ratataplam
Contributor II

I use

 sethostname()

to write my custom hostname on embedded device and works because I don't get back any error and if I read the new hostname with 

gethostname()

 the name is cotrrect, but after hw reboot my hostname go back to old value .

Why? And how can make permament the new value without update any configuration file (e.g. /etc/hostname )?

Thanks

0 项奖励
回复
0 回复数