can't get_block(NO_DEV) any more
[minix.git] / common / lib / libc / net / ntohs.c
blobeb4e841470ee1da3d99d35004d653155841d9bd7
1 /* $NetBSD: ntohs.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */
3 /*
4 * Written by J.T. Conklin <jtc@NetBSD.org>.
5 * Public domain.
6 */
8 #include <sys/cdefs.h>
9 #if defined(LIBC_SCCS) && !defined(lint)
10 __RCSID("$NetBSD: ntohs.c,v 1.1 2005/12/20 19:28:51 christos Exp $");
11 #endif
13 #include <sys/types.h>
15 #undef ntohs
17 uint16_t
18 ntohs(x)
19 uint16_t x;
21 #if BYTE_ORDER == LITTLE_ENDIAN
22 u_char *s = (u_char *) &x;
23 return (uint16_t)(s[0] << 8 | s[1]);
24 #else
25 return x;
26 #endif