summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/POSIX/htonl.c
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2010-09-01 06:42:58 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2010-09-01 06:42:58 +0000
commit2c0464405f411d4ba91bae622fe11a586e8cebaf (patch)
tree2626f828b7694565bf958b45851f14ea92da3ee8 /testsuites/libtests/POSIX/htonl.c
parent2010-08-30 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-2c0464405f411d4ba91bae622fe11a586e8cebaf.tar.bz2
2010-09-01 Ralf Corsépius <ralf.corsepius@rtems.org>
* POSIX/Makefile.am: Add htonl. * POSIX/htonl.c: New.
Diffstat (limited to '')
-rw-r--r--testsuites/libtests/POSIX/htonl.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuites/libtests/POSIX/htonl.c b/testsuites/libtests/POSIX/htonl.c
new file mode 100644
index 0000000000..71aa969db7
--- /dev/null
+++ b/testsuites/libtests/POSIX/htonl.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2010 by
+ * Ralf Corsépius, Ulm, Germany. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+#include <arpa/inet.h>
+
+int
+main (void)
+{
+ uint32_t u32;
+ uint16_t u16;
+
+ u32 = htonl(0x12345678);
+ u16 = htons(0x1234);
+
+ u32 = ntohl(0x12345678);
+ u16 = ntohs(0x1234);
+
+ return 0;
+}