Changeset 4533

Show
Ignore:
Timestamp:
02/08/07 09:34:55 (2 years ago)
Author:
morris
Message:

Add checks for sched...() functions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/config.h.in

    r4518 r4533  
    7777#undef HAVE_QSORT_R 
    7878 
     79/* Define to 1 if you have the `sched_get_priority_max' function. */ 
     80#undef HAVE_SCHED_GET_PRIORITY_MAX 
     81 
     82/* Define to 1 if you have the `sched_get_priority_min' function. */ 
     83#undef HAVE_SCHED_GET_PRIORITY_MIN 
     84 
    7985/* Define to 1 if you have the `setproctitle' function. */ 
    8086#undef HAVE_SETPROCTITLE 
  • libwired/trunk/configure

    r4531 r4533  
    74037403 
    74047404 
     7405 
     7406 
    74057407for ac_func in  \ 
    74067408        daemon \ 
     
    74107412        pthread_attr_setschedpolicy \ 
    74117413        qsort_r \ 
     7414        sched_get_priority_max \ 
     7415        sched_get_priority_min \ 
    74127416        setproctitle \ 
    74137417        srandom \ 
  • libwired/trunk/configure.in

    r4518 r4533  
    227227        pthread_attr_setschedpolicy \ 
    228228        qsort_r \ 
     229        sched_get_priority_max \ 
     230        sched_get_priority_min \ 
    229231        setproctitle \ 
    230232        srandom \ 
  • libwired/trunk/libwired/thread/wi-thread.c

    r4511 r4533  
    109109wi_boolean_t wi_thread_create_thread_with_priority(wi_thread_func_t *function, wi_runtime_instance_t *argument, double priority) { 
    110110#ifdef WI_PTHREADS 
    111 #ifdef HAVE_PTHREAD_ATTR_SETSCHEDPOLICY 
     111#if defined(HAVE_PTHREAD_ATTR_SETSCHEDPOLICY) && defined(HAVE_SCHED_GET_PRIORITY_MIN) && defined(HAVE_SCHED_GET_PRIORITY_MAX) 
    112112        struct sched_param              param; 
    113113        int                                             min, max; 
     
    124124        pthread_attr_init(&attr); 
    125125        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); 
    126 #ifdef HAVE_PTHREAD_ATTR_SETSCHEDPOLICY 
     126#if defined(HAVE_PTHREAD_ATTR_SETSCHEDPOLICY) && defined(HAVE_SCHED_GET_PRIORITY_MIN) && defined(HAVE_SCHED_GET_PRIORITY_MAX) 
    127127        min = sched_get_priority_min(SCHED_OTHER); 
    128128        max = sched_get_priority_max(SCHED_OTHER);