>I'm trying to create a pset with pset_create() and I get errno=1. >In the man of pset_create() is written that this happens when the >{PRIV_SYS_RES_CONFIG} privilege is not asserted in the effectvie >set of the calling process. >Is the problem indeed in the privilege?
truss will show that: % truss -t pset_create psrset -c 1 pset_create(0xFFFFFFFF7FFFF1FC) Err#1 EPERM [sys_res_config] >Now I'm trying to add this privilege to the priv set of my process, but I >don't succeed. >setppriv(PRIV_ON, PRIV_SYS_RES_CONFIG, NULL) - won't work. That's not the proper way to call setppriv: int setppriv(priv_op_t op, priv_ptype_t which, priv_set_t *set); (You need to create a privset and the call would look like: setppriv(PRIV_ON, PRIV_EFFECTIVE, ppriv) or use: priv_set(PRIV_ON, PRIV_EFFECTIVE, PRIV_SYS_RES_CONFIG, NULL); >It returns errno 22 ([i]op[/i] or [i] >which[/i] out of bounds). Not surprising: the second argument is a privilige *set* type and instead you pass a privilige. >When I create a temporary set: [i]priv_set_t *set[/i] and pass it to the >syscall instead of NULL, it also fails. Even if you properly code the privilege calls, you won't magically gain a privilege. Only a privileged process will have privilige. Casper _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code