/** * Copyright - See the COPYRIGHT that is included with this distribution. * pvAccessCPP is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. */ #include #include #include #include #include namespace pva = epics::pvAccess; int main(int argc, char *argv[]) { int ret = 0; try { std::vector name(256u); if(osiGetUserName(&name[0], name.size())!=osiGetUserNameSuccess) throw std::runtime_error("Unable to determine username"); name[name.size()-1] = '\0'; std::cout<<"User: "<<(&name[0])<<"\n"; pva::PeerInfo::roles_t roles; pva::osdGetRoles(&name[0], roles); std::cout<<"Groups: \n"; for(pva::PeerInfo::roles_t::const_iterator it(roles.begin()), end(roles.end()); it!=end; ++it) { std::cout<<" "<<*it<<"\n"; } } catch(std::exception& e) { std::cerr<<"Error: "<