Changeset 2058 for Whitix/trunk/user/posix/socket/socket.c
- Timestamp:
- 05/27/09 08:08:10 (3 years ago)
- Files:
-
- 1 modified
-
Whitix/trunk/user/posix/socket/socket.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/trunk/user/posix/socket/socket.c
r1825 r2058 99 99 } 100 100 101 /* NOTE: The following functions are for little-endian systems only */ 101 102 unsigned short ntohs(unsigned short s) 102 103 { 103 printf("ntohs\n"); 104 return 0; 104 return ((s & 0x00ff) << 8) | 105 ((s & 0xff00) >> 8); 106 105 107 } 106 108 107 short htons(short s)109 unsigned short htons(unsigned short s) 108 110 { 109 printf("htons\n"); 110 return 0; 111 return ntohs(s); 111 112 } 112 113 113 114 unsigned long ntohl(unsigned long l) 114 115 { 115 printf("ntohl\n"); 116 return 0; 116 return ((l & 0x000000ffU) << 24) | 117 ((l & 0x0000ff00U) << 8) | 118 ((l & 0x00ff0000U) >> 8) | 119 ((l & 0xff000000U) >> 24); 117 120 } 118 121 119 long htonl(long l)122 unsigned long htonl(unsigned long l) 120 123 { 121 printf("htonl\n"); 122 return 0; 124 return ntohl(l); 123 125 } 124 126
