Search Results

Search: Posts Made By: pfpietro
1,651
Posted By pfpietro
Ok, this part I got. But how come ? One...
Ok, this part I got.

But how come ?
One process wasn't supposed to fork another process.

-P0 forks P1 and both have i=2

- then only P1 does i++ because:

if(!pid1) i++
P1 is the forked...
1,651
Posted By pfpietro
Very basic problem with fork() using c
Hi guys,
I have the following code:


int main(int argc, char *argv[])
{
int pid1,pid2,i=0;
pid1=fork();
i+=2;
if(!pid1) i++;
if(i%3) pid2=fork(); ...
Forum: Programming 05-29-2013
1,522
Posted By pfpietro
Thanks guys!
Thanks guys!
Forum: Programming 05-24-2013
1,522
Posted By pfpietro
Found the problem! It wasnt the ; but the wait...
Found the problem! It wasnt the ; but the wait cycle!

Thank you all!
1,081
Posted By pfpietro
Problem with fork() while reading files
Good evening everyone. I have my finals and I'm facing a problem:

I have a for cycle that is supposed to fork 2 children but somehow it forks only the first one.

What am I doing wrong ?...
Forum: Programming 05-24-2013
1,522
Posted By pfpietro
[Solved] Problem with fork() while reading files
Good evening everyone. I have my finals and I'm facing a problem:

I have a for cycle that is supposed to fork 2 children but somehow it forks only the first one.

What am I doing wrong ?...
6,607
Posted By pfpietro
I'm using ubuntu 11.04 and compiling with: "gcc...
I'm using ubuntu 11.04 and compiling with: "gcc filename.c -o filename" or "gcc -g filename.c -o filename " when I have to debug using GDB.

Alister, can you explain me what you meant by
* execl...
6,607
Posted By pfpietro
[Quick question]Problem with execl and GREP
Guys, I have the following code


#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>

void read2();
main(int argc,...
Forum: Programming 08-30-2012
1,260
Posted By pfpietro
Thanks Corona688. The problem was caused by the...
Thanks Corona688. The problem was caused by the first forked process. There was no pause() or exit() so he kept looping.
Forum: Programming 08-30-2012
1,260
Posted By pfpietro
Issue when fork()ing processes
Hi guys!
I'll simplify my problem. I have the following code:


#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include <fcntl.h>
#include...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 08:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy