#include #include #include typedef void * (*pthread_func_t) (void *); void myfunc(void *arg) { printf("slave : myfunc runs.\n"); } main() { int ret; pthread_t thread; printf("master : before create a thread ... \n"); ret = pthread_create(&thread, NULL, (pthread_func_t)myfunc, NULL); perror("after creating a thread ... :"); printf("master : after create a thread ... %d(%s)\n", ret, strerror(ret)); if (ret == EAGAIN) { printf("error is EAGAIN\n"); } }