不知道什么原因导致Linux系统执行getconf LONG_BIT显示的值为32,而操作系统实际是64位。
通过修改软链接
[root@server4]#ls -l /usr/libexec/getconf/
lrwxrwxrwx 1 root root 20 6月 5 10:02 default -> POSIX_V6_ILP32_OFF32
[root@server4 getconf]# ln -s POSIX_V6_LP64_OFF64 default
以下为操作过程
[root@server4 ~]# cd /usr/libexec/getconf/
[root@server4 getconf]# ls
default POSIX_V6_ILP32_OFF32 POSIX_V6_ILP32_OFFBIG POSIX_V6_LP64_OFF64 POSIX_V7_ILP32_OFF32 POSIX_V7_ILP32_OFFBIG POSIX_V7_LP64_OFF64
[root@server4 getconf]# ls -l
总用量 152
lrwxrwxrwx 1 root root 20 6月 5 10:02 default -> POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFFBIG
-rwxr-xr-x 2 root root 25536 11月 3 2011 POSIX_V6_LP64_OFF64
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFFBIG
-rwxr-xr-x 2 root root 25536 11月 3 2011 POSIX_V7_LP64_OFF64
[root@server4 getconf]# ls -s default POSIX_V6_LP64_OFF64
0 default 28 POSIX_V6_LP64_OFF64
[root@server4 getconf]# ls -l
总用量 152
lrwxrwxrwx 1 root root 20 6月 5 10:02 default -> POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFFBIG
-rwxr-xr-x 2 root root 25536 11月 3 2011 POSIX_V6_LP64_OFF64
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFFBIG
-rwxr-xr-x 2 root root 25536 11月 3 2011 POSIX_V7_LP64_OFF64
[root@server4 getconf]# ln default POSIX_V6_LP64_OFF64
ln: 创建硬链接"POSIX_V6_LP64_OFF64": 文件已存在
[root@server4 getconf]# ln POSIX_V6_LP64_OFF64 default
[root@server4 getconf]# ls -l
总用量 180
-rwxr-xr-x 3 root root 25536 11月 3 2011 default
lrwxrwxrwx 1 root root 20 6月 5 10:02 default.bak -> POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFFBIG
-rwxr-xr-x 3 root root 25536 11月 3 2011 POSIX_V6_LP64_OFF64
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFFBIG
-rwxr-xr-x 3 root root 25536 11月 3 2011 POSIX_V7_LP64_OFF64
[root@server4 getconf]# ls -l
总用量 180
-rwxr-xr-x 3 root root 25536 11月 3 2011 default
lrwxrwxrwx 1 root root 20 6月 5 10:02 default.bak -> POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFFBIG
-rwxr-xr-x 3 root root 25536 11月 3 2011 POSIX_V6_LP64_OFF64
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFFBIG
-rwxr-xr-x 3 root root 25536 11月 3 2011 POSIX_V7_LP64_OFF64
[root@server4 getconf]# rm default.bak
rm:是否删除符号链接 "default.bak"?y
[root@server4 getconf]# ls -l
总用量 180
-rwxr-xr-x 3 root root 25536 11月 3 2011 default
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFFBIG
-rwxr-xr-x 3 root root 25536 11月 3 2011 POSIX_V6_LP64_OFF64
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFFBIG
-rwxr-xr-x 3 root root 25536 11月 3 2011 POSIX_V7_LP64_OFF64
[root@server4 getconf]# ln POSIX_V6_LP64_OFF64 default
ln: 创建硬链接"default": 文件已存在
[root@server4 getconf]# ls -l
总用量 180
-rwxr-xr-x 3 root root 25536 11月 3 2011 default
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFFBIG
-rwxr-xr-x 3 root root 25536 11月 3 2011 POSIX_V6_LP64_OFF64
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFFBIG
-rwxr-xr-x 3 root root 25536 11月 3 2011 POSIX_V7_LP64_OFF64
[root@server4 getconf]# rm -f default
[root@server4 getconf]# ls -l
总用量 152
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFFBIG
-rwxr-xr-x 2 root root 25536 11月 3 2011 POSIX_V6_LP64_OFF64
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFFBIG
-rwxr-xr-x 2 root root 25536 11月 3 2011 POSIX_V7_LP64_OFF64
[root@server4 getconf]# ln -s POSIX_V6_LP64_OFF64 default
[root@server4 getconf]# ls -l
总用量 152
lrwxrwxrwx 1 root root 19 6月 5 15:25 default -> POSIX_V6_LP64_OFF64
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V6_ILP32_OFFBIG
-rwxr-xr-x 2 root root 25536 11月 3 2011 POSIX_V6_LP64_OFF64
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFF32
-rwxr-xr-x 4 root root 23740 11月 3 2011 POSIX_V7_ILP32_OFFBIG
-rwxr-xr-x 2 root root 25536 11月 3 2011 POSIX_V7_LP64_OFF64
[root@server4 getconf]# getconf LONG_BIT
64
[root@server4 getconf]#