Help with making stuff compile on non-Linux
Sebastian TrĂ¼g
strueg at mandriva.com
Wed Jul 23 09:15:06 BST 2008
On Tuesday 22 July 2008 23:06:23 Alex Merry wrote:
> On Tuesday 22 July 2008 21:25:08 Adriaan de Groot wrote:
> > I'd need more documentation about the intent of using the syscall
> > interface there; while I have access to a Mandriva machine, I'd really
> > prefer not to go reading through system headers.
>
> It's so new that glibc doesn't have a nice wrapper for the syscall yet. It
> would be called something like ioprio_set() if it did.
>
> > setpriority(3c) exists on Solaris, with the same semantics (it's a
> > standard interface).
> >
> > sched_setscheduler(3rt) exists on Solaris, with the same semantics (it's
> > a standard interface, apparently). SCHED_BATCH is not a POSIX scheduling
> > policy; it is not defined in Solaris.
> >
> > setpriority(2) exists on FreeBSD 6-STABLE. I do not know about 7-STABLE
> > or 8- CURRENT, but since it's standard I would assume so.
> >
> > sched_setscheduler(2) exists on FreeBSD 6-STABLE. Same comment for later
> > version support. Same comment for SCHED_BATCH as for Solaris.
>
> I think that lowerIOPriority() should be ifdef'd out (ie: just return
> false) if SYS_ioprio_set is not defined, and lowerSchedulingPriority if
> SCHED_BATCH is not defined. That should fail gracefully at compile time,
> without having to work out what version of what OS supports it.
>
> In particular, lowerSchedulingPriority() should magically work on other
> systems if they start supporting SCHED_BATCH.
>
> Alex
Please find attached a version containing some ifdefs. Do you think I can
commit this or should I wait for Monday in case it breaks for some people and
needs fixing by the real experts. ;)
Cheers,
Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: priority.cpp
Type: text/x-c++src
Size: 2532 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080723/49cbf127/attachment.cpp>
More information about the kde-core-devel
mailing list