Even though the dark-matter power spectrum in the absence of biasing predicts a number density of halos n ( M ) \propto M ^ { -2 } ( i.e . a Schechter \alpha value of -2 ) at the low-mass end ( M < 10 ^ { 10 } M _ { \odot } ) , hydrodynamic simulations have typically produced values for stellar systems in good agreement with the observed value \alpha \simeq - 1 . We explain this with a simple physical argument and show that an efficient external gas-heating mechanism ( such as the UV background included in all hydro codes ) will produce a critical halo mass below which halos can not retain their gas and form stars . We test this conclusion with GADGET-2-based simulations using various UV backgrounds , and for the first time we also investigate the effect of an X-ray background . We show that at the present epoch \alpha is depends primarily on the mean gas temperature at the star-formation epoch for low-mass systems ( z \la 3 ) : with no background we find \alpha \simeq - 1.5 , with UV only \alpha \simeq - 1.0 , and with UV and X-rays \alpha \simeq - 0.75 . We find the critical final halo mass for star formation to be \sim 4 \times 10 ^ { 8 } M _ { \odot } with a UV background and \sim 7 \times 10 ^ { 8 } M _ { \odot } with UV and X-rays .