Skip to main content
1 of 2
goldilocks
  • 90k
  • 33
  • 212
  • 272

sockets use different APIs

That's not entirely true. There are some additional functions for use with sockets, but you can use, e.g., normal read() and write() on a socket fd.

how does this "Everything is a file" apply here?

In the sense that a file descriptor is involved.

If your definition of "file" is a discrete sequence of bytes stored in a filesystem, then not everything is a file. However, if your definition of file is more handle like -- a conduit for information, i.e., an I/O connection -- then "everything is a file" starts to make more sense.

It's not really intended literally, however. A daemon is not a file, a daemon is a process; but if you are doing IPC your method of relating to another process might well be mitigated by file style entities. Etc. Etc.

goldilocks
  • 90k
  • 33
  • 212
  • 272