1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
Description: Fix build with GNU libc 2.41
Author: Aurelien Jarno <aurelien@aurel32.net>
Last-Update: 2025-03-08
Bug-Debian: http://bugs.debian.org/1099285
Forwarded: https://github.com/scheduler-tools/rt-app/pull/136
--- rt-app-1.0.orig/configure.ac
+++ rt-app-1.0/configure.ac
@@ -16,7 +16,7 @@ AC_CHECK_LIB([pthread], [pthread_create]
AC_CHECK_LIB([m], [round])
AC_CHECK_LIB([rt], [clock_gettime])
AC_CHECK_LIB([json-c], [json_object_from_file])
-AC_CHECK_FUNCS(sched_setattr, [], [])
+AC_CHECK_FUNCS(sched_setattr, [have_sched_settattr=yes], [have_sched_settattr=no])
AC_ARG_WITH([deadline],
[AS_HELP_STRING([--with-deadline],
@@ -24,7 +24,7 @@ AC_ARG_WITH([deadline],
[AC_DEFINE([DLSCHED], [1], [Define if you have SCHED_DEADLINE support])],
[with_deadline=no])
-AM_CONDITIONAL([SET_DLSCHED], [test x$with_deadline != xno && test !HAVE_SCHED_SETATTR])
+AM_CONDITIONAL([SET_DLSCHED], [test x$with_deadline != xno && test x$have_sched_settattr = xno])
AC_ARG_VAR([LOGLVL], [verbosity level, from 0 to 100. 100 is very verbose])
--- rt-app-1.0.orig/src/rt-app_args.c
+++ rt-app-1.0/src/rt-app_args.c
@@ -19,6 +19,7 @@ along with this program; if not, write t
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
--- rt-app-1.0.orig/src/rt-app_parse_config.c
+++ rt-app-1.0/src/rt-app_parse_config.c
@@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
+#include <unistd.h>
#include <json-c/json.h>
#include "rt-app_utils.h"
--- rt-app-1.0.orig/src/rt-app_types.h
+++ rt-app-1.0/src/rt-app_types.h
@@ -25,7 +25,10 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <pthread.h>
#include "config.h"
+
+#ifndef HAVE_SCHED_SETATTR
#include "dl_syscalls.h"
+#endif
#define RTAPP_POLICY_DESCR_LENGTH 16
#define RTAPP_RESOURCE_DESCR_LENGTH 16
--- rt-app-1.0.orig/src/rt-app_utils.c
+++ rt-app-1.0/src/rt-app_utils.c
@@ -19,12 +19,15 @@ along with this program; if not, write t
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <math.h>
#include <stdarg.h>
+#include <unistd.h>
+#include <sys/syscall.h>
#include "rt-app_utils.h"
|