In many countries, the duration of copyright is the same for everything. Most of the world is life of the author plus 50-70 years.
US copyright duration is a complex mess of grandfather clauses, but
* any code first published in the US without a copyright notice prior to 1978 (or 1989 in some cases) is in the public domain. A host of other clauses may apply to put it in the public domain in this period, too minor in this case to be noteworthy here; see http://www.copyright.cornell.edu/public_domain/ .
* any code published before 1978 with a copyright notice has 95 years of copyright from publication
* any code published after 1977 and before 2003 by an author who died before 1978 will be in copyright until 2048
* withstanding the last clause, code published after 1977 will be under copyright for the life of the author plus 70 years, or a flat 95 years if a work of corporate authorship
There is some body of code prior to 1978 that is in the public domain due to lack of copyright formalities; AT&T settled with Berkeley over early Unix because the judge refused a preliminary injunction on Berkeley because he found it likely that Unix code had so fallen into the public domain. http://www.ibiblio.org/jmaynard/ says "IBM, by corporate policy, does not assert copyright ownership of any software which it distributed without copyright notices." Other than that, it's all under copyright for a long, long time.