Some jurisdictions, such as New York City, require self-closing, self-locking doors to the entry of multiple family dwellings (,8 or more units), but do not seem to require them on smaller housing units (such as one or two family homes) or on the individual apartments within a larger unit.
Even when locks are required, they do not need to be in the knob of the door. Often there is no in knob lock but an auxiliary self locking mechanism higher up on the door. Many exit door locksets do not even have a knob, but a thumb latch. A single key often controls the self locking latch and the deadbolt.
I do not know your particular locale's code, but I would be surprized if there is a regulation about locks at all (other than a prohibition on a door that can't be opened from the inside without a key). It would be very strange if they required an in-knob lock, especialyl if you have an auxiliary latch or deadbolt.
SUPPLEMENT
I since have found more code in NYC concerning mandated deadbolts and door chains or similar devices on individual apartments, but still nothing requiring an in-knob lock.
I dissembled the knob to figure out how the privacy lock mechanism works.
The slider moves a sleeve around the square axle between the door knobs.
When the round part of the sleeve is around the axle, the axle can turn and the door is unlocked.
When the square part of the sleeve is around the axle, the axle can't turn and the door is locked.
The little metal flange I found under the knob outside the door is supposed to be able to turn and work the slider.
At this point I realized that it had all been installed incorrectly. The two parts need to match up like this:
The mechanisms must have been installed in a different way such that they didn't match up correctly. When I went to put them together properly, I found out why. The gold pin is so long that it doesn't fit when installed in the proper position. When I tried to assemble it with the parts aligned properly, there was a 1/8" gap.
The lock manufacturer probably made the pin oversized so that the lock could be installed on multiple width doors. For doors less than the maximum thickness, the installer should trim the pin to the correct length. When the pin was untrimmed, it couldn't be installed such that it was in the correct position. The person that installed this knob, found a way to get it to fit, but the "unlock from outside" feature was non-functional.
I used a pair of pliers to cut 1/8" off the end of the pin.
When I re-assembled the lock and knob, the privacy feature works perfectly. The door can be unlocked from the outside just by moving the protruding metal nub under the handle with your finger.
Best Answer
Turning the latch mechanism can work, but you need a shaft that closely fits the circular shape around the opening.
Instead, just slide one of the little ears with tools or fingers to retract the bolt: