Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    How to get the number of elements in a SystemV queue

    Hello everybody,
    I'm trying to create a function that takes a pointer of a task_struct process in input and returns the number of elements in a SystemV queue related with it (I have several tasks that created SystemV queues).

    int getQueueElements(struct task_struct *p){
    struct ipc_namespace *ns;
    struct ipc_ids *ipc;
    int qNum;

    ns = p->nsproxy->ipc_ns;
    ipc = ns->ids[IPC_MSG_IDS];
    qNum = ipc->in_use;
    if(ipc->seq_max != -1)return qNum;


    I have written the function above but it lets me to know only the number of IPC objects currently in use, and not the number of messages on queue related with the process p.

    Thanks in advance for any suggestion about.

  2. #2
    I forgot to specify that I'm working on an optimized scheduling policy for certain real-time processes based on SystemV queues for IPC, and I need to know the queues level to perform some operations.

  3. #3
    Maybe I have solved adding a new field in the task_struct, in order to store the SysV queue unique Key during the queue creation.
    In this way I should obtain all queues information (if the process uses queues) from the task_struct of a process...

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts