00001 /* 00002 * Written by J.T. Conklin . 00003 * Public domain. 00004 * 00005 * CHANGELOG: this file has been modified by Sergio Perez Alcañiz <serpeal@disca.upv.es> 00006 * Departamento de Informática de Sistemas y Computadores 00007 * Universidad Politécnica de Valencia 00008 * Valencia (Spain) 00009 * Date: March 2003 00010 * 00011 */ 00012 00013 #include <sys/types.h> 00014 #include <rtl_sched.h> 00015 #undef htonl 00016 00017 /* */ 00018 /* htonl */ 00019 in_addr_t htonl(in_addr_t x) 00020 { 00021 #if BYTE_ORDER == LITTLE_ENDIAN 00022 u_char *s = (u_char *)&x; 00023 return (in_addr_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]); 00024 #else 00025 return x; 00026 #endif 00027 }