1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-12 14:43:24 +00:00

Lots of minor corrections

This commit is contained in:
Gerhard Rieger 2023-10-01 19:53:55 +02:00
parent 7d6295114b
commit 1c1a91027a
19 changed files with 197 additions and 78 deletions

View file

@ -32,6 +32,23 @@ int hostan(FILE *outfile) {
fprintf(outfile, "sizeof(long long) = %u\n", (unsigned int)sizeof(long long));
#endif
fprintf(outfile, "sizeof(size_t) = %u\n", (unsigned int)sizeof(size_t));
{
union {
uint16_t s;
uint8_t c[2];
} bo;
bo.c[0] = 0x05;
bo.c[1] = 0xa0;
if (bo.s == 0x05a0) {
fprintf(outfile, "host byte order: network (BE \"big endian\", most significast byte first)\n");
} else if (bo.s == 0xa005) {
fprintf(outfile, "host byte order: intel (LE \"little endian\", least significast byte first\n");
} else {
fprintf(outfile, "host byte order: unknown\n");
fprintf(stderr, "failed to determine host byte order");
}
}
#include <sys/time.h> /* select(); OpenBSD: struct timespec */
fprintf(outfile, "sizeof(struct timespec) = %u\n", (unsigned int)sizeof(struct timespec));
fprintf(outfile, "sizeof(struct diag_dgram) = %u\n", (unsigned int)sizeof(struct diag_dgram));