Sponsored Content
Top Forums Programming How forbid use fork() in exec() program. Post 302416678 by Corona688 on Tuesday 27th of April 2010 11:37:49 AM
Old 04-27-2010
Quote:
Originally Posted by kzi
Hello World!
I am writing code in C++ which have to launch another application X using exec().
exec() doesn't as much launch another application as much as replace the same process with a different one, fyi.
 

10 More Discussions You Might Find Interesting

1. Programming

Fork and exec

Hello! I am working on a server where I should have 4 (resident)processes, one of them being "the father" of the others, so I do 3 forks. The problem that I have is that I do an accept (for sockets) in the "father" process and I want to transmit the job to one of the processes "child" with... (3 Replies)
Discussion started by: driki
3 Replies

2. UNIX for Dummies Questions & Answers

FORK/EXEC technique

Hi! Can someone explain me exactly this technique? Why a process (PARENT) creates a copy of itself with FORK (CHILD)? What's the reason of this behaviour? Sorry, but I cannot understand the logic behind it. Thanks. (4 Replies)
Discussion started by: marshmallow
4 Replies

3. Programming

fork/exec clobbers write. I need ideas why...

On my *nix box, I have a telegram program. When I go like tel person "la\nla\nla\n" the person sees "la\nla\nla\n" However, when I have a program that forks and execs tel like: pid = fork(); if (pid < 0) { perror("fork failed"); exit(EXIT_FAILURE); } if (pid == 0) {... (7 Replies)
Discussion started by: frequency8
7 Replies

4. Solaris

fork and exec ftp

Hi, I need to find/implement an application that FTPs (puts) all new files in a certain directory to an external storage unit. This application should check for new files every 10 seconds (leaving the FTP connection open in between the 10 seconds). The easiest way would be if there are... (2 Replies)
Discussion started by: KittyJ
2 Replies

5. Shell Programming and Scripting

fork and exec

I need to ssh to a remote server and run my script there. This is my script. $ssh = "ssh username@host"; $cmd = "$ssh 'cd <my dir> && < sudo Run_exe>'"; my $pid = fork; if ($pid == 0){ exec $cmd; } When I run this I get: pccons_getchar: got r == 0 (1 Reply)
Discussion started by: looza
1 Replies

6. Programming

fork() and the program is hanging...

Consider the following code.. #include <unistd.h> #include <sys/types.h> #include <errno.h> #include <stdio.h> #include <sys/wait.h> #include <stdlib.h> int main() { pid_t childpid; int retval; int status; childpid = fork(); if(childpid >= 0) { ... (4 Replies)
Discussion started by: lipun4u
4 Replies

7. Programming

Fork and then exec problem with signals

Hi All, In my program i am handling SIGHUP signal. In the handler i fork and then exec on child process same binary file which is running. Parent process will die after 10 mins. Now my child process which was exec with same binary file is not receiving SIGHUP signal. Below is the progran code:... (6 Replies)
Discussion started by: sushil_shalin
6 Replies

8. Programming

Newbie question on exec,fork, wait,pipe C

Hello everybody.I want to make clear that i am not going to ask from anybody to build my asignement but i have a big problem. I can't seem to find anywhere ONE good example on C about what i am trying to do:wall:.I think it is simple. All i ask is one example, even a link is fine. So, i want to... (1 Reply)
Discussion started by: Cuervo
1 Replies

9. UNIX for Dummies Questions & Answers

fork with exec

What is is difference between 'fork with exec' and 'fork without exec'? How both are related? (1 Reply)
Discussion started by: kkalyan
1 Replies

10. UNIX for Beginners Questions & Answers

Question about global environment variables & fork() exec()

Hello... And thanks in advance for any help anyone can offer me on my question! I've been doing a lot of reading to try and find my answer... But I haven't had any luck What I'm trying to understand is where a child process inherits global environment variables from? I understand the exec()... (2 Replies)
Discussion started by: bodisha
2 Replies
numa_sched_launch(5)						File Formats Manual					      numa_sched_launch(5)

NAME
numa_sched_launch - change process default launch policy VALUES
Failsafe Default Allowed values Recommended values unless the application requires explicit different behavior. DESCRIPTION
The dynamic tunable controls the default launch policy for newly created processes. The process launch policy controls the initial place- ment of the child process at creation time. The scheduler can migrate threads from one locality domain (LDOM) to another to distribute workload for better throughput and responsiveness. The default launch policy is applicable only to processes that have no explicit launch policy, processor binding, or LDOM binding applied to them (see mpctl(2) for details). There are three possible values of this tunable: This value explicitly disables any change in the default launch policy for processes irrespective of the system configuration. A newly created process will be placed using the legacy default launch policy. This is the default and recommended value. HP-UX will autosense the right policy setting based on system configuration. This policy directs HP-UX to optimize the launch policy for multi-process applications that share data. Such applications can get better performance when the applications are packed together in the same LDOM. The policy will cause child processes created using to be placed in the same locality domain as the parent process. Note that a different default launch policy may be used in the future with new system configurations for improved application performance when this tunable is enabled. Processes created using will be treated as if they are a new application and will continue to be launched using the legacy default launch policy. This value explicitly enables the new default launch policy for processes. A process created using is placed in the same locality domain as its parent process irrespective of the system configuration. Who Is Expected to Change This Tunable? System administrators who prefer to explicitly control the default launch policy for applications even when LORA (Locality Optimized Resource Alignment) mode is enabled (see numa_policy(5) for details). Restrictions on Changing The tunable changes take effect immediately. However, changes to this tunable will not affect processes that are already created. Such processes will need to be stopped and restarted to be launched with a modified tunable setting. When Should the Value of This Tunable Be Changed to 0? The value of should be set to to preserve the legacy process default launch policy even when the system is configured in LORA mode. When Should the Value of This Tunable Be Changed to 1? The value of should be set to to improve the performance of multi-process applications. When Should the Value of This Tunable Be Changed to 2? The value of should be set to when a multi-process application is likely to see improved performance even if the system is not configured for LORA mode. What Are the Side Effects of Changing the Value? The distribution of CPU utilization across the system will change. This situation can result in a change in performance. The change in performance is highly dependent on the workload and the partition configuration. What Other Tunable Values Should Be Changed at the Same Time? None. WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of HP-UX. Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun- able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see at AUTHOR
was developed by HP. SEE ALSO
fork(2), mpctl(2), vfork(2), numa_policy(5). Tunable Kernel Parameters numa_sched_launch(5)
All times are GMT -4. The time now is 05:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy