陳鍾誠

Version 1.0

參考文獻

程式

關注範例:

guest@localhost:~/sp/ccc/sys-prog-examples/simple-examples$ ./endianness
Hex of the four bytes: deadbeef
Writing 4 bytes, 1 byte at a time
Note: If you are on a little-endian machine, this actually wrote: 0xefbeadde to the file! Run 'hexdump -C endianness.temp' or 'xxd endianness.temp' to convince yourself of that!
Reading 4 bytes.
We read the same thing that we wrote.
Reading 4 bytes into an array.
0xef was the first byte in the array

We created the file 'endianness.temp'. You can safely delete it.
current working directory: /home/guest/sp/ccc/sys-prog-examples/simple-examples
stat(/Makefile): No such file or directory
current working directory: /
found /Makefile
Breaking out of chroot....
current working directory (escape part 1): (unreachable)/home/guest/sp/ccc/sys-prog-examples/simple-examples
current working directory (escape part 2): (unreachable)/
current working directory (escape part 3): /
listing of files in this directory
bin   home            lib32       media  root  srv  var
boot  initrd.img      lib64       mnt    run   sys  vmlinuz
dev   initrd.img.old  libx32      opt    sbin  tmp  vmlinuz.old
etc   lib             lost+found  proc   snap  usr