- 论坛徽章:
- 0
|
shell模式下:
/usr/wangjm> uname -X
获得下面的信息:
System = SCO_SV
Node = scounix
Release = 3.2v5.0.5
KernelID = 98/07/02
Machine = i80386
BusType = ISA
Serial = 2FI100628
Users = 5-user
OEM# = 0
Origin# = 1
NumCPU = 1
我在/etc/hosts下more看到
# @(#)hosts,v 6.1 1993/08/21 02:17:48 stevea Exp - STREAMware TCP/IP source
# SCCS IDENTIFICATION
127.0.0.1 localhost
10.168.2.143 atmp atmp
我的问题是,我想通过gethostname() --> gethostbyname() 来获取IP地址信息,好像输入的名字是"atmp",而不能是"scounix",那我怎么得到"atmp"呢,我输入hostname或者uname,返回都是"scounix",怎么得到"atmp"呢?
[ 本帖最后由 reneyangs 于 2008-1-16 16:52 编辑 ] |
|