I'm trying to create a new contract with the following code  
int main()
{
        int     tmpl_fd;
        ctid_t  ctid;

        if ((tmpl_fd = open64("/system/contract/process/template", O_RDWR)) == 
-1) {
                perror("Can't open /system/contract/process/template \n");
                return -1;
        }else
                printf("open /system/contract/process/template \n");

        if (ct_tmpl_activate(tmpl_fd) != 0) {
                perror("Can't activate process contract template");
                return -1;
        }else
                 printf("Activate contract template \n");

        if (ct_tmpl_create(tmpl_fd, &ctid) != 0) {
                perror("Can't create process contract template");
                return -1;
        }else
                printf("Create contract template ctid is -: %d\n",ctid);

        return 0;
}

However, I’m getting an error "Can't create process contract template: 
[b]Invalid argument[/b]". According to the man pages of ct_tmpl_create() we 
have to pass the file descriptor of the templates, which is I'm doing.

When I go through the source code of contract I found that in file 
"...../usr/src/uts/commmon/os/contract.c" there is function 
ctmpl_create_inval() which is called at the time of calling ct_tmpl_create().
But this function is always return EINVAL (invalid argument).

Help me to sort out this problem, since ct_tmpl_create() is not implemented in 
any of the tools of open solaris.
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to