exec « fork « C Q&A

Home
C Q&A
1.assembly
2.buffer
3.Card
4.Cast
5.compile
6.console
7.const
8.constructor
9.database
10.Date
11.Debug
12.Design
13.Development
14.DLL
15.encrypt
16.enum
17.eof
18.Event
19.fork
20.Format
21.gcc
22.gdb
23.graph
24.graphics
25.gui
26.Holiday Event
27.image
28.IP
29.iterator
30.macro
31.makefile
32.malloc
33.Menu
34.mysql
35.network
36.openssl
37.operator
38.password
39.pipe
40.preprocessor
41.printf
42.pthread
43.Regular expression
44.scanf
45.semaphore
46.SerialPort
47.server
48.Socket
49.sql
50.SQLserver
51.sscanf
52.std
53.stdin
54.stdout
55.stl
56.strcmp
57.stream
58.switch
59.Template
60.thread
61.timer
62.unix
63.video
64.Virtual
65.visualstudio
66.winapi
67.windows
68.xml
C Q&A » fork » exec 

1. Having trouble with fork(), pipe(), dup2() and exec() in C    stackoverflow.com

Here's my code:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <wait.h>
#include <readline/readline.h>

#define NUMPIPES 2

int main(int argc, char *argv[]) {
    char *bBuffer, *sPtr, *aPtr = NULL, *pipeComms[NUMPIPES], *cmdArgs[10];
    int fdPipe[2], ...

2. Does this multiple pipes code in C makes sense?    stackoverflow.com

I've created a question about this a few days. My solution is something in the lines of what was suggested in the accepted answer. However, a friend of mine came ...

3. How to create a process on Mac OS using fork() and exec()    stackoverflow.com

I am working on a relatively simple, independent "process starter" that I would like to get to work on Windows (XP, Vista, 7), Linux (Ubuntu 10.10) and especially Mac OS X ...

4. exec() not working with firefox    stackoverflow.com

I've been using a combination of fork() and exec() to execute some external command on linux, however, the code seems to fail whenever I try to execute /usr/bin/firefox which is a ...

5. Passing a pipe as a parameter in exec    stackoverflow.com

I'm trying to pass a pipe to another process, which I create with execv. This is my code so far, but it doesn't work. I've looked everywhere for information, ...

6. Problem with directories in C    stackoverflow.com

I'm making a program for Linux in C that recieves a directory as an argument, then for each file in that directory and each of it's sub-directories, calls a program called ...

7. execl only executing once in a forked process, C programming    stackoverflow.com

For some reason that I am unaware of, my only my first execl statement is executing in the following code:

pid = fork();
if(pid < 0){
    fprintf(stderr, "Fork Failed.\n");
  ...

8. C: Exec/fork > Defunct processes    stackoverflow.com

I'm want to create a lot of child processes using the fork > exec procedure. Many processes are ending very fast (in less than two minutes, some even earlier). My first problem ...

9. Multiple pipes in C    stackoverflow.com

I want to implement multi pipes in c so I can do something like this, where ||| means duplicate the stdin to N pipe commands): cat /tmp/test.log ||| wc -l ||| grep ...

10. multi pipes in C    stackoverflow.com

I am trying to implement multiple pipes in C, the solution should be both for:

cmd1 | cmd2 | cmd3
and for:
        |--- cmd2

cmd1    ...

11. Multiple fork() in switch lead to exponential exec    stackoverflow.com

I have a program which executes multiple programs depending on i. See the following code block:

for(i=0;i<5;i++){
 switch(i){
  case 0:
    if(fork())result=execl(transportProtoSnd,transportProtoSnd,RTPport, NULL);
    if(result<0){printf("ERRNO: %d\n", errno);exit(0);}
 ...

12. Is it possible to fork/exec and guarantee one starts before the other?    stackoverflow.com

Pretty much as the title says. I have a snippet of code that looks like this:

pid_t = p;

p = fork();

if (p == 0) {
    childfn();
} else if (p ...

13. trouble with fork() and exec()    bytes.com

Problem solved. Actually the prob wasn't with my Parent code but it was the other program code which I was trying to spawn. Added a while(1){} to the code and it worked well. Previously the code had exited (thru return 0) thus, resulting the myApp to appear when spawned. Thanks Raghu and cheers....

14. Fork() and exec() help    cboard.cprogramming.com

15. fork/exec vi problem    cboard.cprogramming.com

16. Having trouble with fork(), pipe(), dup2() and exec() (pipes exercise)    cboard.cprogramming.com

Here's my code: Code: #include #include #include #include #include int main(int argc, char *argv[]) { char *bBuffer, *sPtr, *aPtr = NULL, *pipeComms[2], *cmdArgs[10]; int fdPipe[2], pCount, aCount, i, status; pid_t pid; pipe(fdPipe); while(1) { bBuffer = readline("Shell> "); if(!strcasecmp(bBuffer, "exit")) { return 0; } sPtr = bBuffer; pCount = -1; do { aPtr = strsep(&sPtr, "|"); ...

17. fork + exec    cboard.cprogramming.com

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.