Hello,
the attached patch fixes a problem that prevented ioprio support from
being built on my system (an ubuntu edgy). The problem was that
_syscall2 only works in the kernel tree, but is not part of the linux
headers in /usr/include. So I had a look at how it was done in the
schedutils package instead.
Cheers,
Gabriel de Perthuis
Index: configure.in
===================================================================
RCS file: /cvs/gnome/tracker/configure.in,v
retrieving revision 1.28
diff -u -7 -r1.28 configure.in
--- configure.in	19 Oct 2006 01:30:17 -0000	1.28
+++ configure.in	20 Oct 2006 20:20:23 -0000
@@ -435,21 +435,22 @@
 ####################################################################
 
 AC_MSG_CHECKING([[checking ioprio support]])
 ioprio_support=no
 AC_RUN_IFELSE([ AC_LANG_PROGRAM([[
 #include <stdlib.h>
 #include <errno.h> 
-#include <linux/unistd.h> 
-   ]], [[
-_syscall2(int, ioprio_get, int, which, int, who); 
-int main()
+#include <sys/syscall.h>
+#include <unistd.h>
+inline int ioprio_get (int which, int who)
 {
-	exit(ioprio_get(1,0));
+	return syscall (__NR_ioprio_get, which, who);
 }
+   ]], [[
+exit(ioprio_get(1,0));
    ]]) ], 
    [ AC_DEFINE(IOPRIO_SUPPORT,[],[Define ioprio support]) ioprio_support=yes ])
 AC_MSG_RESULT([$ioprio_support])
 
 #####################################################
 
 AM_CONFIG_HEADER(src/trackerd/config.h)
Index: src/trackerd/tracker-ioprio.c
===================================================================
RCS file: /cvs/gnome/tracker/src/trackerd/tracker-ioprio.c,v
retrieving revision 1.2
diff -u -7 -r1.2 tracker-ioprio.c
--- src/trackerd/tracker-ioprio.c	11 Oct 2006 23:30:55 -0000	1.2
+++ src/trackerd/tracker-ioprio.c	20 Oct 2006 20:20:23 -0000
@@ -18,14 +18,15 @@
  * Boston, MA 02111-1307, USA.
  */
  
 #include <stdio.h>
 #include <errno.h>
 #include <glib/gstdio.h>
 #include <tracker-utils.h>
+#include <sys/syscall.h>
 #ifdef HAVE_LINUX_UNISTD_H
 #include <linux/unistd.h>
 #endif
 #include "tracker-ioprio.h"
 
 #ifdef IOPRIO_SUPPORT
 
@@ -40,16 +41,23 @@
 	IOPRIO_WHO_PROCESS = 1,
 	IOPRIO_WHO_PGRP,
 	IOPRIO_WHO_USER,
 };
 
 #define IOPRIO_CLASS_SHIFT	13
 
-_syscall2(int, ioprio_get, int, which, int, who); 
-_syscall3(int, ioprio_set, int, which, int, who, int, ioprio); 
+static inline int ioprio_set (int which, int who, int ioprio)
+{
+	return syscall (__NR_ioprio_set, which, who, ioprio);
+}
+
+static inline int ioprio_get (int which, int who)
+{
+	return syscall (__NR_ioprio_get, which, who);
+}
 
 void ioprio()
 {
 	int ioprio = 7, ioprio_class = IOPRIO_CLASS_BE;
 	tracker_log ("Setting ioprio best effort.");
 	
 	if (ioprio_set(IOPRIO_WHO_PROCESS,0,ioprio | ioprio_class << IOPRIO_CLASS_SHIFT) == -1) {
_______________________________________________
tracker-list mailing list
tracker-list@gnome.org
http://mail.gnome.org/mailman/listinfo/tracker-list

Reply via email to