this is similar to creating an extension to some program, because the extension could not be written without the original even if the interface the extension is using is a public API. the claim has been made that the copyright of the original program applies. i think the linux kernel is an example here.
see also these questions on stackexchange:
https://softwareengineering.stackexchange.com/questions/2087...
https://softwareengineering.stackexchange.com/questions/8675...