GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
#include "gnunet_common.h"
#include "gnunet_os_lib.h"
-#define VERBOSE 0
static int
testprio ()
{
- pid_t child;
if (GNUNET_OK !=
- GNUNET_OS_set_process_priority (getpid (),
+ GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
GNUNET_SCHEDULER_PRIORITY_DEFAULT))
return 1;
-#ifndef MINGW
- child = fork ();
- if (child == 0)
- {
- sleep (10);
- exit (0);
- }
if (GNUNET_OK !=
- GNUNET_OS_set_process_priority (child, GNUNET_SCHEDULER_PRIORITY_IDLE))
+ GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
+ GNUNET_SCHEDULER_PRIORITY_UI))
+ return 1;
+ if (GNUNET_OK !=
+ GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
+ GNUNET_SCHEDULER_PRIORITY_IDLE))
+ return 1;
+ if (GNUNET_OK !=
+ GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
+ GNUNET_SCHEDULER_PRIORITY_BACKGROUND))
+ return 1;
+ if (GNUNET_OK !=
+ GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
+ GNUNET_SCHEDULER_PRIORITY_HIGH))
+ return 1;
+ if (GNUNET_OK !=
+ GNUNET_OS_set_process_priority (GNUNET_OS_process_current (),
+ GNUNET_SCHEDULER_PRIORITY_HIGH))
return 1;
-#endif
return 0;
}