I need to create a negative voltage rail (from positive supply rail), say -5V to keep a P-MOS transistor in ON-state even when the voltage on its [S] source is 0V. So I found this schematic in an answer of another question here, but does this actually work?
Contrary to popular belief this does work, but the P7805 is a DC to DC converter and it can sink current. A regular 7805 voltage regulator requires a negative supply, this does not. Here is a excerpt from the P7805 datasheet: