diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-01-25 22:45:11 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-01-25 22:45:11 +0000 |
commit | 72c1491bba149c8fbd9eb81a0a529aa8bad47bb5 (patch) | |
tree | 22544335c6c060175878b8bd05f459cbbe0d3fd0 /winsup/cygwin/include | |
parent | 17923424c4bc8d7f132e174939814baebdbae1a0 (diff) | |
download | cygnal-72c1491bba149c8fbd9eb81a0a529aa8bad47bb5.tar.gz cygnal-72c1491bba149c8fbd9eb81a0a529aa8bad47bb5.tar.bz2 cygnal-72c1491bba149c8fbd9eb81a0a529aa8bad47bb5.zip |
* cygwin.din: Export getpriority and setpriority.
* fork.cc (fork_parent): Copy parent's nice value into child.
* spawn.cc (spawn_guts): Ditto.
* miscfuncs.cc (winprio_to_nice): New function.
(nice_to_winprio): Ditto.
* pinfo.cc (pinfo_init): If parent is not a Cygwin process, set
default nice value according to current Win32 priority class.
* pinfo.h (class _pinfo): Add nice member.
* syscalls.cc (setpriority): New function, only implementing
PRIO_PROCESS for now.
(getpriority): Ditto.
(nice): Just call setpriority.
* wincap.h (wincaps::has_extended_priority_class): New element.
* wincap.cc: Implement above element throughout.
* winsup.h: Add prototypes for winprio_to_nice and nice_to_winprio.
* include/limits.h (NZERO): New define.
* include/cygwin/types.h (id_t): New datatype.
* include/cygwin/version.h: Bump API minor version.
* include/sys/resource.h: Add PRIO_XXX defines and prototypes for
getpriority and setpriority.
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r-- | winsup/cygwin/include/cygwin/types.h | 6 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/limits.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/resource.h | 8 |
4 files changed, 19 insertions, 1 deletions
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h index aaa0f67f1..3964ae3a9 100644 --- a/winsup/cygwin/include/cygwin/types.h +++ b/winsup/cygwin/include/cygwin/types.h @@ -99,6 +99,12 @@ typedef __ino32_t ino_t; #endif #endif /*__ino_t_defined*/ +/* Generic ID type, must match at least pid_t, uid_t and gid_t in size. */ +#ifndef __id_t_defined +#define __id_t_defined +typedef unsigned long id_t; +#endif /* __id_t_defined */ + #if defined (__INSIDE_CYGWIN__) struct __flock32 { short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index f81bc2afc..c38fc5520 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -245,12 +245,13 @@ details. */ getlogin_r. 116: Export atoll. 117: Export utmpx functions, Return utmp * from pututent. + 118: Export getpriority, setpriority. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 117 +#define CYGWIN_VERSION_API_MINOR 118 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/include/limits.h b/winsup/cygwin/include/limits.h index 25136acdf..5ef3513ce 100644 --- a/winsup/cygwin/include/limits.h +++ b/winsup/cygwin/include/limits.h @@ -182,5 +182,8 @@ details. */ #define RTSIG_MAX _POSIX_RTSIG_MAX +/* Used for nice and get/setpriority. */ +#define NZERO 20 + #endif /* _MACH_MACHLIMITS_H_ */ #endif /* _LIMITS_H___ */ diff --git a/winsup/cygwin/include/sys/resource.h b/winsup/cygwin/include/sys/resource.h index c1fe544a9..d2de569cd 100644 --- a/winsup/cygwin/include/sys/resource.h +++ b/winsup/cygwin/include/sys/resource.h @@ -17,6 +17,11 @@ details. */ extern "C" { #endif +/* Used for get/setpriority */ +#define PRIO_PROCESS 0 +#define PRIO_PGRP 1 +#define PRIO_USER 2 + #define RLIMIT_CPU 0 /* CPU time in seconds */ #define RLIMIT_FSIZE 1 /* Maximum filesize */ #define RLIMIT_DATA 2 /* max data size */ @@ -68,6 +73,9 @@ int setrlimit (int __resource, const struct rlimit *__rlp); int getrusage (int __who, struct rusage *__rusage); +int getpriority (int which, id_t who); +int setpriority (int which, id_t who, int value); + #ifdef __cplusplus } #endif |