swap_lw_bytes, swap_word_bytes, swap_words - General: Perform byte-swapping operations
unsigned int swap_lw_bytes(
unsigned int buffer ); unsigned int swap_word_bytes(
unsigned int buffer ); unsigned int swap_words(
unsigned int buffer );
Specifies a 32-bit (4 bytes) quantity.
The swap_lw_bytes interface performs a longword byte swap. The swap_word_bytes interface performs a short word byte swap. The swap_words
interface performs a word byte swap. Many computer vendors support devices that use a big endian model of byte ordering. Because Digital
devices support the little endian model of byte ordering, there is a need for these byte-swapping interfaces. In addition, some buses (for
example, the VMEbus) can have specific or implied byte ordering that may require the use of these interfaces.
Given that a longword is equal to 4 bytes; a short word is equal to 2 bytes; and 1 byte is equal to 8 bits, these interfaces swap bytes as
follows: The swap_lw_bytes interface takes the 32-bit quantity specified by the buffer argument and swaps all 4 bytes. The swap_word_bytes
interface takes the 32-bit quantity specified by the buffer argument and swaps the individual bytes that make up each word of the 32-bit
quantity. The swap_words interface takes the 32-bit quantity specified by the buffer argument and swaps the two 16-bit words.
The following illustration compares the byte swapping performed by these interfaces.
+---+---+---+---+ Starting value: | a | b | c | d |
Long word byte swap
+---+---+---+---+ Ending value: | d | c | b | a |
Short word byte swap
+---+---+---+---+ Ending value: | b | a | d | c |
+---+---+---+---+ Starting value: | ab | cd |
Word byte swap
+---+---+---+---+ Ending value: | cd | ab |
Upon successful completion, these interfaces return the swapped bytes.
I have search how to optimize and configure Swap file into another partition on Jaguar.
The steps are in french (for this moment and the next thread will be in US)
. How to delocalize and Configuring your Swap under OS X Jaguar (server+Client)
.How to configure your partition size... (3 Replies)
Can anyone explain the difference between Paging and Swap in unix. I know over the years that the term has almost become interchangable.
However I have noticed in VMSTAT for a Solaris system that I am investigating that there is significant Paging but no Swapping and hence I am wondering do I... (2 Replies)
Does anyone know if when the Swap Device / Page file in unix is carrying out Page / Swap In's and Page / Swap outs, does it go through the Unix Disk Cache ( I am presuming raw partitions are not being used ) ?
Therefore if there is paging activity on a system ( measured by sar -p, sar -g and... (0 Replies)
Hi. I have to swap the first and the third word in all lines of a txt file using sed.
Separators between words are: any charachter, except intervall.
I hope, you'll understand what I want to do. my english is not so good, sorry for that:) (10 Replies)