What is special about /dev/tty?

The ‘c’ means it’s a character device. tty is a special file representing the ‘controlling terminal’ for the current process. Character Devices Unix supports ‘device files’, which aren’t really files at all, but file-like access points to hardware devices. A ‘character’ device is one which is interfaced byte-by-byte (as opposed to buffered IO). TTY /dev/tty … Read more

Reasoning behind C sockets sockaddr and sockaddr_storage

I’m looking at functions such as connect() and bind() in C sockets and notice that they take a pointer to a sockaddr struct. I’ve been reading and to make your application AF-Independent, it is useful to use the sockaddr_storage struct pointer and cast it to a sockaddr pointer because of all the extra space it … Read more

tech