Linux 判断机器的字节顺序
#include <fcntl.h>
int main(void)
{
typedef union un{
short s;
char c[sizeof(short)];
}un;
un myun;
myun.s = 0x0102;
if(sizeof(short) == 2){
if(myun.c[0] == 1 && myun.c[1] == 2)
printf("big-endian\r\n");
else if(myun.c[0] == 2 && myun.c[1] == 1)
printf("little-endian\r\n");
else
printf("unkown\r\n");
}
return 0;
}
摘自《Unix 网络编程》
相关文档:
administer@administer-laptop:~/tem/tt$ cat hello.asm
[section .data]
strHello db "Hello, world!",0Ah
STRLEN equ $-strHello
[section .text]
global _start
_start:
mov edx,STRLEN
mov ecx,strHello
mov ebx,1
mov eax,4
int 0x80
mov  ......
Device eth0 has different MAC address than expected
前天在弄VMware的时候,在VMware上clone了一个linux,后来在clone的linux(RedHat Enterprise Linux 4)上不能上网了,激活eth0时老弹出 Device eth0 has different MAC address than expected ,我们只要编辑这个文件:/etc/sysconfig/network-scripts/ifcfg- ......
此处vmware版本为6.5 ,主机为windows xp,vmware 安装了redhat linux
1.网络设置:
打开vmware,点vmware->setting->Hardware->Newwork Adapter->Custom - >
VMnet1(host-only)
查看windows网络连接,看到一个VMnet1的连接,设置它的ip与子网掩码。如:IP:192.168.13.1 ,子网掩码 255.255.255.0 ......
学用Linux命令
2006-01-23 11:18:22 虫子虫子爬@-FiFb /article/-FiFb-liXUWS.html 复制 评论
基础教程-学用Linux命令(1)
Linux虽然是免费的,但它的确是一个非常优秀的操作系统,与MS-WINDOWS相比具有可靠、稳定、速度快等优点,且拥有丰富的根据UNIX版本改进的强大功能。下面,作为一个典型的DOS 和WINDOWS用户, ......
1, 下载 VMWare Player
http://www.vmware.com/products/player/
简
单注册一下,就可以下载了。
2, 生成 VMWare 的种子文件
http://www.easyvmx.com/new-easyvmx.shtml
3,
下载 你想要的Linux 的 ISO 文件。
4, 解压缩 2 中的 VMWare种子文件, 双击其中的
扩展名为vmx的文件。 然后在VMWarePlayer 中 设置 ......