Long waves in a current of an inviscid fluid of constant density flowing through a channel of arbitrary cross section under disturbances of pressure distribution on free surface and obstructors on the wall of the channel are considered. The first order asymptotic approximation of the elevation of the free surface satisfies a forced Korteweg-de Vries equation when the current is near its critical state. To determine the coefficients of the forced Korteweg-de Vries equation, we need to solve a linear Neumann problem of an elliptic partial differential equation, of which analytical solutions are found for constant current and rectangular or triangular cross section of the channel. It is proved that the forced Korteweg-de Vries equation has at least two solutions when the current is supercritical and the parameter λ is greater than a critical value λ c >0. It is also proved that there do not exist solitary waves in a current exactly at its critical state. Numerical solutions of steady state are obtained for both supercritical and subcritical currents.