sex determination

The genetic or environmental process by which the sex of an individual is established.