pthread_create() Problem..

This is a discussion on pthread_create() Problem.. within the C Programming forums, part of the General Programming Boards category; Hi All, i am getting the following error while compiling the program : ERROR; return code from pthread_create() is 251 ...

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    22

    pthread_create() Problem..

    Hi All,
    i am getting the following error while compiling the program :

    ERROR; return code from pthread_create() is 251

    Is anyone have idea what could be the reason or when error number 251 is coming ?

    following the loop where i m calling the pthread_create function.

    for(t=0;t<NUM_THREADS;t++)
    {
    printf("Creating thread %d\n", t);
    rc = pthread_create(&thread[t], NULL, fn_process, (void *) t);
    if (rc)
    {
    printf("\n ERROR; return code from pthread_create() is %d\n ", rc);
    exit(0);
    }
    }

    pls help me to sort out.

    thanks.

  2. #2
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,656
    Did you compile with -lpthread ? My source indicates that error 251 appears to be
    Code:
    #define ENOSYS          251     /* Function not implemented     */
    although I can't confirm this. I don't have a POSIX threads library.

  3. #3
    Registered User
    Join Date
    Feb 2006
    Posts
    22
    thnx a lot . i was nt using -lpthread while compiling.Now its running fine.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21