Sponsored Content
Top Forums UNIX for Dummies Questions & Answers UNIX System Call for creating process Post 302185792 by chanikya on Wednesday 16th of April 2008 01:32:24 AM
Old 04-16-2008
Lightbulb UNIX System Call for creating process

Hell Sir,
This is chanikya
Is there any System call which behaves just like fork but i dont want to return back two times to the calling func.
In the following ex iam creating a child process in the called func but the ex prints two times IN MAIN.


ex :-

calling()
{
fork();

}

main()
{
calling();
printf("IN MAIN\n");
}
 

10 More Discussions You Might Find Interesting

1. Programming

sigwait system call in UNIX signal

Hi Everybody, I have gone through man of sigwait and new to UNIX signals. Could anyone explain me about the following lines mentioned in sigwait man help ? "The selection of a signal in set is independent of the signal mask of the calling thread or LWP. This means a thread or LWP can ... (1 Reply)
Discussion started by: md7ahuja
1 Replies

2. IP Networking

any system call in unix to access ip routing table

hi is there any system call by which ip routing table can be accessed. (1 Reply)
Discussion started by: vinodkumar
1 Replies

3. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

4. UNIX for Advanced & Expert Users

Creating System Call, need PID of caller

Hey I am creating a new system call that needs to know the PID of the calling process. I am new to coding in the kernel, so I don't know if this is possible... Any help would be nice. Thanks! Hapatchi (4 Replies)
Discussion started by: Hapatchi
4 Replies

5. Shell Programming and Scripting

script to monitor the process system when a process from user takes longer than 15 min run.

get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same. hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Discussion started by: kirankrishna3
1 Replies

6. Programming

UNIX system call in COBOL

Hi, The UNIX system call inside the COBOL program is doing the specified command correctly. MOVE W080-UNZIP-FILE-COMMAND TO W080-OUTPUT-COMMAND CALL "SYSTEM" USING W080-OUTPUT-COMMAND RETURNING W080-SYS-CALL-STATUS BUT The problem is, the following keeps on showing on the log file... (2 Replies)
Discussion started by: joyAV
2 Replies

7. Shell Programming and Scripting

creating an automation process in unix .

hi i need shell script in ksh for the automation process in informtica. The automation process is like this . i have a folder in unix . when this folder gets updated (like if a file or files is/are added to the folder) an event in informatica is triggered and after the process is done in... (2 Replies)
Discussion started by: kumar8887
2 Replies

8. UNIX for Advanced & Expert Users

Unix script seems to be momentarily creating child process for unknown reason

Hi, I have a unix script that basically has a while loop inside which it checks Oracle database for certain records. If it finds the records, it does some processing and then goes back to the while loop. If it doesnot find any matching records, then it sleeps for 30 seconds and then goes back to... (17 Replies)
Discussion started by: waavman
17 Replies

9. Homework & Coursework Questions

Creating a .profile, displaying system variables, and creating an alias

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Here is what I am supposed to do, word for word from my assignment page: 1. Create/modify and print a... (2 Replies)
Discussion started by: Jagst3r21
2 Replies

10. UNIX for Beginners Questions & Answers

Exit() system call verses process signals

Hello and thanks in advance for any help anyone can offer me I've been reading up on process signal calls (sighup, sigint, sigkill & sigterm) and I understand they all have different methods of terminating a running process. From what I've also read is a exit() actually terminates a process. ... (2 Replies)
Discussion started by: bodisha
2 Replies
CPU_LWP_FORK(9) 					   BSD Kernel Developer's Manual					   CPU_LWP_FORK(9)

NAME
cpu_lwp_fork, child_return, proc_trampoline -- finish a fork operation SYNOPSIS
#include <sys/proc.h> void cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize, void (*func)(void *), void *arg); void child_return(void *arg); DESCRIPTION
cpu_lwp_fork() is the machine-dependent portion of fork1() which finishes a fork operation, with child lwp l2 nearly set up. It copies and updates the PCB and trap frame from the parent l1, making the child ready to run. cpu_lwp_fork() rigs the child's kernel stack so that it will start in proc_trampoline(). proc_trampoline() does not have a normal calling sequence and is entered by cpu_switch(). If an alternate user-level stack is requested (with non-zero values in both the stack and stacksize arguments), the user stack pointer is set up accordingly. After being entered by cpu_switch() and while running in user context (within the kernel) proc_trampoline() will invoke the function func with the argument arg. If a kernel thread is being created, the return path and argument are specified with func and arg. If a user process is being created, fork1() will pass child_return() and l2 to cpu_lwp_fork() as func and arg respectively. This causes the newly-created child process to go directly to user level with an apparent return value of 0 from fork(2), while the parent process returns normally. SEE ALSO
fork(2), cpu_switchto(9), fork1(9) BSD
April 13, 2010 BSD
All times are GMT -4. The time now is 01:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy