Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

FileWvIn.cpp File Reference

#include "../include/FileWvIn.h"
#include <cmath>
#include <iostream>

Include dependency graph for FileWvIn.cpp:

Go to the source code of this file.

Functions

int set_fifo_priority (bool half)
 Set fifo priority (if user has sufficient privileges).


Function Documentation

int set_fifo_priority bool  half  ) 
 

Set fifo priority (if user has sufficient privileges).

Definition at line 264 of file MainDialog.cpp.

References get_fifo_priority().

Referenced by FileWvIn::run().

00265 {
00266   struct sched_param p;
00267   int priority;
00268   //  scheduling priority
00269   
00270   
00271   if (true)             // (!getuid () || !geteuid ())
00272     {
00273       priority = get_fifo_priority (half);
00274       p.sched_priority = priority;
00275       
00276       if (sched_setscheduler (0, SCHED_FIFO, &p) == -1)
00277         {
00278           fprintf (stderr,
00279                    "\ncould not activate scheduling with priority %d\n",
00280                    priority);
00281           return -1;
00282         }
00283       seteuid (getuid ());
00284       //                fprintf (stderr,
00285       //                         "\nset scheduling priority to %d (SCHED_FIFO)\n",
00286       //                         priority);
00287     }
00288   else
00289     {
00290       fprintf (stderr,
00291                "\ninsufficient privileges to set scheduling priority\n");
00292       priority = 0;
00293     }
00294   return priority;
00295 }

Here is the call graph for this function:


Generated on Thu Aug 3 16:14:49 2006 by  doxygen 1.4.4