Blame
Date:
Mon Jan 11 09:00:47 2021 UTC
Message:
a usleep makes it unnecessary slow, I guess it forces a context switch...
01
2017-10-26
pjp
/*
02
2017-10-26
pjp
* $OpenBSD: endian.h,v 1.18 2006/03/27 07:09:24 otto Exp $
03
2017-10-26
pjp
*/
04
2014-11-14
pjp
05
2014-11-14
pjp
/*-
06
2014-11-14
pjp
* Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
07
2014-11-14
pjp
*
08
2014-11-14
pjp
* Redistribution and use in source and binary forms, with or without
09
2014-11-14
pjp
* modification, are permitted provided that the following conditions
10
2014-11-14
pjp
* are met:
11
2014-11-14
pjp
* 1. Redistributions of source code must retain the above copyright
12
2014-11-14
pjp
* notice, this list of conditions and the following disclaimer.
13
2014-11-14
pjp
* 2. Redistributions in binary form must reproduce the above copyright
14
2014-11-14
pjp
* notice, this list of conditions and the following disclaimer in the
15
2014-11-14
pjp
* documentation and/or other materials provided with the distribution.
16
2014-11-14
pjp
*
17
2014-11-14
pjp
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18
2014-11-14
pjp
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
2014-11-14
pjp
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
2014-11-14
pjp
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
2014-11-14
pjp
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
2014-11-14
pjp
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
2014-11-14
pjp
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
2014-11-14
pjp
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
2014-11-14
pjp
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
2014-11-14
pjp
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
2014-11-14
pjp
*/
28
2014-11-14
pjp
29
2014-11-14
pjp
/*
30
2014-11-14
pjp
* Generic definitions for little- and big-endian systems. Other endianesses
31
2014-11-14
pjp
* has to be dealt with in the specific machine/endian.h file for that port.
32
2014-11-14
pjp
*
33
2014-11-14
pjp
* This file is meant to be included from a little- or big-endian port's
34
2014-11-14
pjp
* machine/endian.h after setting _BYTE_ORDER to either 1234 for little endian
35
2014-11-14
pjp
* or 4321 for big..
36
2014-11-14
pjp
*/
37
2014-11-14
pjp
38
2014-11-14
pjp
#define NTOHL(x) (x) = ntohl((u_int32_t)(x))
39
2014-11-14
pjp
#define NTOHS(x) (x) = ntohs((u_int16_t)(x))
40
2014-11-14
pjp
#define HTONL(x) (x) = htonl((u_int32_t)(x))
41
2014-11-14
pjp
#define HTONS(x) (x) = htons((u_int16_t)(x))
42
2014-11-14
pjp
repomaster@centroid.eu