Early in the eighteenth century, wives and girlfriends, as well as the occasional prostitute, were allowed to go to sea with the sailors during long voyages.
When one of them became pregnant and was about to give birth at sea, a canvas curtain was placed near the midship gun where the birth would take place.
If the newborn’s father was in doubt, and it often was, the birth was registered in the log as the “son of a gun.”