Questions tagged as 'posix'

2
answers

Fork in Windows

There is something in Windows like (or some similar alternative to) fork POSIX systems (UNIX and Mac) to create a child process that is an exact copy of the parent and runs from the calling point? As far as I know CreateProcess...
asked by 05.03.2016 / 00:58
1
answer

Run-time error in pthreads

My function main was thus (% with% was set further back): int main() { int i; int *result; pthread_t tid[N]; for (i=0; i<N; i++) { if (pthread_create (&tid[i], 0 ,fnThread, (void*)(&i)) != 0){ printf("Er...
asked by 01.10.2017 / 12:01
1
answer

"SIGSEGV" error when receiving a large data packet

Hello, I'm experiencing a "SIGSEGV" error when receiving a large data packet with the recv function of the library using C language on a Posix-UNIX system, if any soul can help me one thank you. buffer: char ls_buffer_PPouAUT[2048] = {0...
asked by 21.07.2016 / 14:17
1
answer

How to reuse a pthreads?

I'm using pthread.h and using the following functions: // // Cria A thread // thread_argsPP[contthreadsPP] = contthreadsPP; pthread_create(&threadsPP[contthreadsPP], NULL, ReceivePinPad, (void *) &thread_argsPP[cont...
asked by 21.07.2016 / 15:13
0
answers

POSIX - problems writing to file using open and write

On this code below, this is giving the problem in write, however if I use creat without the flags it runs. The goal is to copy a file, the file that will be copied if it is called 'test.txt' and what will be created 'novoteste.txt', but if novot...
asked by 07.11.2017 / 18:26
1
answer

how to solve "SIGSEGV" error when using 'strcpy'

Hello, I'm experiencing a "SIGSEGV" error on the following line: strcpy(buffer_ReceiveAutomation, ls_buffer_PPouAUT);
asked by 22.07.2016 / 19:07
1
answer

Entry in if () but instructions are not executed

I am trying to make a chat using pipes (chat between server and client). I made an exit condition, in case the server wants to quit / disconnect the chat it writes "quit", in the client in the same way. Doing "quit" from the server is working, h...
asked by 27.05.2017 / 22:25
1
answer

SIGSEGV error in using a pointer

I have the following problem: I'm creating a pointer and allocating memory in it, passing its reference to function, but when I read it in function the error occurs in the title. Function: void FileLer(char *texto, char *file) { //...
asked by 22.08.2016 / 15:48
1
answer

Doubt with use of 'pthread' in posix

I am using the following routine with command pthread.h library: // // Declaração // pthread_t threads[NUM_THREADS]; // // Criacao // for(...) { pthread_create(&threads[i], NULL, MainTH, (void *) &thread_ar...
asked by 02.08.2016 / 14:44