forked from Imagelibrary/rtems
2010-09-01 Ralf Corsépius <ralf.corsepius@rtems.org>
* POSIX/Makefile.am: Add htonl. * POSIX/htonl.c: New.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
24
testsuites/libtests/POSIX/htonl.c
Normal file
24
testsuites/libtests/POSIX/htonl.c
Normal file
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user