diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2010-09-01 06:42:58 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2010-09-01 06:42:58 +0000 |
commit | 2c0464405f411d4ba91bae622fe11a586e8cebaf (patch) | |
tree | 2626f828b7694565bf958b45851f14ea92da3ee8 /testsuites | |
parent | 2010-08-30 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-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 'testsuites')
-rw-r--r-- | testsuites/libtests/ChangeLog | 5 | ||||
-rw-r--r-- | testsuites/libtests/POSIX/Makefile.am | 3 | ||||
-rw-r--r-- | testsuites/libtests/POSIX/htonl.c | 24 |
3 files changed, 32 insertions, 0 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog index fba80aeeba..894a5ef54d 100644 --- a/testsuites/libtests/ChangeLog +++ b/testsuites/libtests/ChangeLog @@ -1,3 +1,8 @@ +2010-09-01 Ralf Corsépius <ralf.corsepius@rtems.org> + + * POSIX/Makefile.am: Add htonl. + * POSIX/htonl.c: New. + 2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de> * malloctest/init.c: Update for heap API changes. diff --git a/testsuites/libtests/POSIX/Makefile.am b/testsuites/libtests/POSIX/Makefile.am index b4aae1b999..cbb043b2d1 100644 --- a/testsuites/libtests/POSIX/Makefile.am +++ b/testsuites/libtests/POSIX/Makefile.am @@ -52,6 +52,9 @@ getuid_SOURCES = getuid.c # check_PROGRAMS += issetugid # issetugid_SOURCES = issetugid.c +check_PROGRAMS += htonl +htonl_SOURCES = htonl.c + check_PROGRAMS += lseek lseek_SOURCES = lseek.c 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; +} |