A spectrum-sharing communication system where the secondary user is aware of the instantaneous channel-state information (CSI) of the secondary link but knows only the statistics and an estimated version of the secondary transmitter-primary receiver link is investigated. The optimum power profile and the ergodic capacity of the secondary link are derived for general fading channels [with a continuous probability density function (pdf)] under the average and peak transmit power constraints and with respect to the following two different interference constraints: 1) an interference outage constraint and 2) a signal-to-interference outage constraint. When applied to Rayleigh fading channels, our results show, for example, that the interference constraint is harmful at the high-power regime, because the capacity does not increase with the power, whereas at the low-power regime, it has a marginal impact and no-interference performance, which corresponds to the ergodic capacity under average or peak transmit power constraint in the absence of the primary user, may be achieved.