This option has completely been removed from the Mac OS X kernel five years ago.
In XNU 792 (Mac OS X 10.4.x Tiger), it still existed:
#define KERN_TFP_POLICY_DENY 0 /* Deny Mode: None allowed except privileged */
#define KERN_TFP_POLICY_PERMISSIVE 1 /* Permissive Mode: related ones allowed or privileged */
#define KERN_TFP_POLICY_RESTRICTED 2 /* Restricted Mode: privileged or setgid and realted */
In the more recent XNU 1228 (Mac OS X 10.5.x Leopard) it's been removed:
#define KERN_TFP_POLICY_DENY 0 /* Deny Mode: None allowed except privileged */
#define KERN_TFP_POLICY_DEFAULT 2 /* Default Mode: related ones allowed and upcall authentication */
Since 1 is not a valid value for this option anymore, your call fails with that error message.
It seems there's no way to circumvent this anymore, so you'll have to use the procmod group membership.
As a workaround, look into man taskgated. It has a parameter that allows Tiger compatibility, as well as a few others.
Accepts the old (Tiger) convention that a process with a primary effective group of procmod or procview is allowed to get task ports. Without this option, this legacy mode is not supported.
You'd probably need to change the launchd plist and relaunch that service. Not sure if that's possible with your use case.
procmodgroup? – Daniel Beck♦ Oct 31 '11 at 13:01procmodgroup is just as good (although not system-wide), would this work for you? – Daniel Beck♦ Oct 31 '11 at 19:26