It’s not quite as hopeless as artloversplus makes it seem. 25% of Residency Match positions go to graduates of international medical school. It is true that a majority of the matches are in primary care specialties (though internal medicine beats family medicine); however, that might be due to the preferences of the international applicants. Keep in mind that international primary care physicians can self-petition for a green card while other specialists have to be sponsored for a temporary work visa and then hope that their employer will petition for their green card later. That’s a very strong incentive for foreign medical graduates to choose primary care specialties.
In this context, it’s also worth noting that a full one third of the available surgical residency positions go un-matched. Do hospitals refuse to even consider international applicants for surgical residency positions? Or do the foreign applicants just not want these positions?
Match statistics here: http://www.nrmp.org/wp-content/uploads/2014/04/Main-Match-Results-and-Data-2014.pdf