Magic numbers often refer to specific constants that identify a structure, file type or software. In this case, the tty_driver's magic number is apparently always defined like this:
#define TTY_DRIVER_MAGIC 0x5402
One practical use of the magic number in such a context might be to check the value of the first sizeof(int)
bytes and make sure they == 0x5402
before casting the rest of the received bytes into a tty_driver struct
. In this respect, it might also be used to determine the appropriate byte ordering (little/big endian) for the rest of the header.