Measurements were performed at the time-of-flight facility GELINA to determine the 238U(n,gamma) cross section in the resonance region. Experiments were carried out at a 12.5 and 60 m measurement station. The total energy detection principle in combination with the pulse height weighting technique was applied using C6D6 liquid scintillators as prompt gamma-ray detectors. The energy dependence of the neutron flux was measured with ionisation chambers based on the 10B(n,alpha) reaction. The data were normalised to the isolated and saturated 238U resonance at 6.67 eV. Special procedures were applied to reduce bias effects due to the weighting function, normalization, dead time and background corrections, and corrections related to the sample properties. The total uncertainty due to the weighting function, normalization, neutron flux and sample characteristics is about 1.5 %. Resonance parameters were derived from a simultaneous resonance shape analysis of the GELINA capture data and transmission data obtained previously at a 42 m and 150 m station of ORELA. The parameters of resonances below 500 eV are in good agreement with those resulting from an evaluation that was adopted in the main data libraries. Between 500 eV and 1200 eV a systematic difference in the neutron width is observed. Average capture cross section data were derived from the experimental capture yield in the energy region between 3.5 keV and 90 keV. The results are in good agreement with an evaluated cross section resulting from a least squares fit to experimental data available in the literature prior to this work. The average cross section data derived in this work were parameterised in terms of average resonance parameters and included in a least squares analysis together with other experimental data reported in the literature.