Find the answer to your Linux question:
Results 1 to 2 of 2
hi I am using the sched_setaffinity function to allot each thread to specific processor. I am getting the following warning. "implicit decelaration of function 'sched_setaffinity' I have included the "sched.h" ...
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Location
    Pakistan
    Posts
    4

    setting processor affinity

    hi

    I am using the sched_setaffinity function to allot each thread to specific processor. I am getting the following warning.

    "implicit decelaration of function 'sched_setaffinity'

    I have included the "sched.h" header file. I am using Linux red hat 4 enterprise AS and gcc 3.4.6.

    How can i overcome this warning.
    Is there any external library for this like -lpthread and -lm.

    Can anyone help me on this
    Thanks

  2. #2
    Linux User
    Join Date
    Jul 2004
    Location
    Poland
    Posts
    368
    Quote Originally Posted by mhjamal View Post
    hi

    I am using the sched_setaffinity function to allot each thread to specific processor. I am getting the following warning.

    "implicit decelaration of function 'sched_setaffinity'

    I have included the "sched.h" header file. I am using Linux red hat 4 enterprise AS and gcc 3.4.6.

    How can i overcome this warning.
    Is there any external library for this like -lpthread and -lm.

    Can anyone help me on this
    Thanks
    0) RTFM
    1) Probably you need to include sched the following way:
    #define _GNU_SOURCE
    #include <sched.h>
    2) This function might no be supported on your system, check its man page (or google for it) for versions of kernel and glibc from which it is supported.
    "I don't know what I'm running from
    And I don't know where I'm running to
    There's something deep and strange inside of me I see"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...