2024-04-16 04:31:24 +02:00
|
|
|
/* $OpenBSD: htons.c,v 1.10 2024/04/15 14:30:48 naddy Exp $ */
|
2023-04-30 03:15:27 +02:00
|
|
|
/*
|
|
|
|
* Public domain.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <endian.h>
|
|
|
|
|
|
|
|
#undef htons
|
|
|
|
|
2024-04-16 04:31:24 +02:00
|
|
|
uint16_t
|
|
|
|
htons(uint16_t x)
|
2023-04-30 03:15:27 +02:00
|
|
|
{
|
2024-04-16 04:31:24 +02:00
|
|
|
return htobe16(x);
|
2023-04-30 03:15:27 +02:00
|
|
|
}
|