title: Trying to change realtime clock in Ubuntu 14.04 in C++ application, getting "Operation not permitted"
body: <p><strong>OS:</strong> Ubuntu</p>
  
  <p><strong>Version:</strong> 14.04</p>
  
  <p><strong>Language:</strong> C++11</p>
  
  <p>I've written an application that needs to change the real-time clock based on different sources.  As background, the reason that I'm not using NTP to manage this is based on different clock sources that are needed at different points, for all the current applications using CLOCK_REALTIME. This application receives a clock reference time and sets the clock using <code>clock_settime</code>.  This returns the message <code>Operation not permitted</code>.</p>
  
  <p><code>if(clock_settime(CLOCK_REALTIME, &amp;timeRT) != 0)
  {
      std::cerr &lt;&lt; "  Set clock_settime(CLOCK_REALTIME, &amp;timeRT) = " &lt;&lt; strerror(errno) &lt;&lt; std::endl;
  }</code></p>
  
  <p>I presume the applications privileges are not set correctly.  </p>
  
  <ul>
  <li>Any direction on how to do this?</li>
  <li>Anything else I should check?</li>
  </ul>