How to Use macro _POSIX_SOURCE with pthread

Thread Tools Search this Thread
Top Forums Programming How to Use macro _POSIX_SOURCE with pthread
# 1  
Old 11-17-2002
How to Use macro _POSIX_SOURCE with pthread

I use Digital Unix 4.0F (OSF/1) .I write a simple programe :

#include <pthread.h>

void main(void)
{ }

But , the compiler report many errors .
I do not know why the compiler compain that .

Thank you in advance
# 2  
Old 11-17-2002
You need to use:
#define _POSIX_C_SOURCE 199506L

You can get more info by reading the well commented /usr/include/pthread.h. (Tested on 4.0G)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming


I have a while loop like so: while (counter (file1)); how can I pass that into a pthread_create()? I was thinking ... while(pthread_create(&path, NULL, counter, file)); is that right? (1 Reply)
Discussion started by: l flipboi l
1 Replies

2. Programming

Help with pthread error

I have written a C code and when i compile it there are 0 warnings and 0 errors, but when i try to run apears: ./client: symbol lookup error: ./client: undefined symbol: pthread_create, version GLIBC_2.1 the part of the code where i have the pthread_creat is: int serverConection(int... (5 Replies)
Discussion started by: SuperStout
5 Replies

3. Ubuntu

pthread problem

Hi all, I wrote some code in c, using pthread (I configured the linker and compiler in eclipse IDE first). #include <pthread.h> #include "starter.h" #include "UI.h" Page* MM; Page* Disk; PCB* all_pcb_array; void* display_prompt(void *id){ printf("Hello111\n"); return... (1 Reply)
Discussion started by: elad2109
1 Replies

4. UNIX for Advanced & Expert Users


I am so confused about the user threads and kernel threads.Suppose I created a thread using pthread create call in Linux ,whether it will be a user thread or kernel thread.If it user thread,then how its map to kernel thread. I heard about the M:1,M:N,1:1 mapping methods.Which method linux is... (1 Reply)
Discussion started by: sujith4u87
1 Replies

5. Programming

How can I parallize using pthread

Hi all, How can i parallize this code in pthread? for(round=1;round<=16;round++) { Expansion(mid, 17 - round - 1, left); Expansion(mid, round - 1, right); round++; Expansion(right, 17 - round - 1, mid); Expansion(left, round - 1,mid); } Whereby each loop depend on the... (2 Replies)
Discussion started by: m_enayah
2 Replies

6. Programming

Make-question - redefine a macro, using another macro..?

I think there is no problem to use any macro in a new macro definishion, but I have a problem with that. I can not understand why? I have a *.mak file that inludes file with many definitions and rules. ############################################## include dstndflt.mak ... One of the... (2 Replies)
Discussion started by: alex_5161
2 Replies

7. Solaris

pthread problem

Hi all! I am working on unix systems.I am programming in c. I have got some problems with pthread.when I use pthread_create to creat a thread it says: (.text+0x3a): undefined reference to `pthread_create'. same is the problm with pthread_kill. Can anyone help me out here. Thanks. vij. (2 Replies)
Discussion started by: vijlak
2 Replies

8. Programming


hallo 2 al can anyone pls tell me where and how can i find and install the pthread.h lib ? thx :cool: (2 Replies)
Discussion started by: XinU*
2 Replies

9. Programming


consider if the thread routine returns any void pointer while calling pthread_join, the thread resources are freed and the thread will be terminated when the main thread is exit ,that is my assumption whether it is true how do we find whether the thread is alive or terminated how do we find... (0 Replies)
Discussion started by: MKSRaja
0 Replies

10. Programming

More about Pthread

Can someone point to a link where I can get good info about pthread? thanx.. :) (1 Reply)
Discussion started by: jyotipg
1 Replies
Login or Register to Ask a Question