Move portable operating-system interface from the `cc` example to the library