[TUHS] Any UNIX With No C In Userland?
Lars Brinkhoff
lars at nocrew.org
Tue Mar 4 16:37:56 AEST 2025
Noel Chiappa writes:
> The area I'm thinking of (and which I saw a lot of) is code to implement
> network protocols (and I'm fairly astounded that nobody else has mentioned
> this yet).
Network packets, tape records, disk images. It's a bit off-topic, so I
have tried to stay silent.
> One has to have _absolute_ control over how the bits are laid out
> in the packet (which of course might wind up in any one of countless other
> machine types) - which generally means how they are laid out in memory.
> The whole concept of C declarations is not rich enough to really deal with
> this properly.
I NEVER EVER use C structs or bit fields for this. I get the raw octets
(or whatever the byte size is), and shift and mask accordingly to get
the data fields.
More information about the TUHS
mailing list