Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to set High Thread Priority?
Qt 6.11 is out! See what's new in the release blog

How to set High Thread Priority?

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kostya111
    wrote on last edited by
    #1

    I use Qt for Embedded Linux 4.7.3. And I have a thread that should be run with high priority. But to set high priority to thread a process have to have root privileges. But I don't want process is running with root privileges.

    I have tried two approches:

    1. I execute process by root, set the thread high priority and call setuid(1000) to reduce the privilege level.
      But, in this case 'Qt for Embedded Linux data directory'(/tmp/qtembedded-0) is owned by root and after changing process uid my program can't access it.

    2. I execute process by root with setuid flag, so process have ordinary uid at startup, then I wanna call seteuid(0) to set the thread high priority and then call setuid(1000) to reduce the privilege level at all.
      In this case my program Aborted with text "Qt for Embedded Linux data directory is not owned by user 0".

    How can I set high thread priority and leave program with ordinary privilege level?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved