KcsProfileDesc desc; KcsCreationDesc c_desc; KcsProfileId profileid; KcsStatusId status; KcsErrDesc errDesc; /* The filename is a command line argument */ /* Create a new profile with the default CMM */ desc.type = KcsSolarisProfile; desc.desc.solarisFile.fileName = argv[1]; desc.desc.solarisFile.hostName = NULL; desc.desc.solarisFile.oflag = O_RDWR|O_CREAT|O_TRUNC; desc.desc.solarisFile.mode = 0666; c_desc.profileDesc = &desc; c_desc.desc.id.cmmId = 0; c_desc.desc.id.cmmVersionId = 0; c_desc.desc.id.profileId = 0; c_desc.desc.id.profileVersionId = 0; status = KcsCreateProfile(&profileid, &c_desc); if(status != KCS_SUCCESS) { KcsGetLastError(&errDesc); printf("CreateProfile error: %s\n", errDesc.desc); } |
Other required fields in the profile must be set with KcsSetAttribute().