Sponsored Content
Full Discussion: exec() system call
Top Forums Programming exec() system call Post 47093 by a25khan on Monday 2nd of February 2004 08:13:38 PM
Old 02-02-2004
exec() system call

hi there,
i was reading about the exec() function. and if i m not wrong, exec() kills your present process and starts a new process in its place. the process id remains the same.
then it says if exec is successful the text data and stack are overlayed by new file! -
i dont get this part "only user area is maintained across exec system call"
can someone tell me what the user area is in particular? like what part of a program would be user area!?
Thank You!
 

10 More Discussions You Might Find Interesting

1. 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

2. Programming

alternatives of exec() system function

Hi , Can anybody name any System Function in C/C++ for Sun-Solaris (unix) platform which can serve the alternative of execl() system function. Actually I am calling a fork-execl() pair and then making an interprocess communication between these two(parent-child process). But the problem is... (3 Replies)
Discussion started by: Raj Kumar Arora
3 Replies

3. UNIX for Advanced & Expert Users

exec to call specific function in C prog

I would like to call a particular function in a C program using execl(). Is this possible using execl or anyother function ? Thanks (2 Replies)
Discussion started by: vpraveen84
2 Replies

4. Shell Programming and Scripting

How to execute piped command using exec or system

Hi All, I want to execute a piped command like 'ls /opt | grep xml' using array as parameters list. How can I do that? (2 Replies)
Discussion started by: bharadiaam
2 Replies

5. Shell Programming and Scripting

system call

Hi, How to write a system calls in a script ? > cd $HOME > ls -ltr thanks in advance.. (10 Replies)
Discussion started by: hegdeshashi
10 Replies

6. Shell Programming and Scripting

Perl variables in exec or system

I am new in Perl. I am working in simple script and the varibles are working well outside the exec or system command. but they don't work as parameters to exec or system command. The script is attached. please help. (8 Replies)
Discussion started by: ahmed_zaher
8 Replies

7. UNIX for Dummies Questions & Answers

How to run two commands from a exec call in a c program

Hi, I have to run two commands one after another from a c program. How can i do this with exec system calls. i tried giving them as argument to execv but it is not working.please help thanks (3 Replies)
Discussion started by: suryashikha
3 Replies

8. Programming

system call

I have a cgi script which is called after certain time interval, which has this: system ("ls -l /tmp/cgic* | grep -v \"cgicsave.env\" | awk '{print $5}'"); During the execution of this script,the output is 0 sometimes. But due to this the system call is not working at all and doesnt o/p... (2 Replies)
Discussion started by: xs2punit
2 Replies

9. Programming

need help with system call

hi everyone i wrote a system call and compiled the kernel succesfully... my system call is in a file in the kernel folder named my_syscall1.c (kernel/my_syscall1.c) the header file for this system call i added it in the folder include like this include/my_syscall1/my_syscall1.h my problem is... (2 Replies)
Discussion started by: demis87
2 Replies

10. Programming

[C] exec system call

Hi again ;) Now I want to make a program that will execute the programs with exec, asking the user if he wants the program to run in background or foreground. scanf("%c",&caracter); if (caracter=='y'){ printf("Has decidido ejecutarlo en background\n"); if((pid=fork())==0) {// fork para... (3 Replies)
Discussion started by: lamachejo
3 Replies
getaddressconf(2)						System Calls Manual						 getaddressconf(2)

NAME
getaddressconf - Gets information about system address space configuration SYNOPSIS
#include <sys/types.h> #include <sys/addrconf.h> int getaddressconf ( struct addressconf *buffer, size_t length ); PARAMETERS
Points to an array of addressconf structures. Specifies the size in bytes of the array pointed to by the buffer parameter. DESCRIPTION
The getaddressconf() function fills in the array of structures pointed to by the buffer parameter with information describing the configu- ration of process address spaces on this system. This information is intended to be used by programs such as the program loader, which need to manage the contents of a process' address space using the memory management primitives such as the mmap() function. The buffer parameter points to an array of addressconf structures, occupying a total of length bytes. Each element of the array describes a single area of the process address space. The addressconf structure is defined in the sys/addrconf.h header file, and it contains the following members: caddr_t ac_base; unsigned ac_flags; The base virtual address of the area. For an upward-growing area, this is the low- est virtual address in the area; for a downward-growing area, this is the lowest virtual address above the area. The flags describe the area. They are also defined in the sys/addrconf.h header file, and are described as follows: The area grows towards higher addresses. The base address specified is the lowest address in the area. The area grows towards lower addresses. The base address specified is the low- est address above the area. The area always starts at the specified base address. For example, on many machines the text area is a fixed area. The area floats to the first available virtual address above the specified base address. For example, on many machines, the data area floats above the text area. Each element in the array of addressconf structures describes a separate area of the process' address space. These areas have been defined in the sys/addrconf.h header file; other areas may be defined in the future or on other machine types. The array elements are indexed with the following constants: The area that normally contains the text region of an absolute executable program. The area that normally con- tains the data region of an absolute executable program. The area that normally contains the bss region of an absolute executable program. The area that normally contains the process' user-mode stack. The area reserved for the text region of the default program loader see the exec_with_loader() function. The area reserved for the data region of the default program loader. The area reserved for the bss region of the default program loader. The area that normally contains text regions of relocatable files loaded by the program loader, or otherwise mapped using the mmap() function. The area that normally contains data regions of relocatable files loaded by the program loader, or oth- erwise mapped using the mmap() function. The area that normally contains the bss regions of relocatable files loaded by the program loader, or anonymous regions mapped using the mmap() function. The sys/addrconf.h header file also defines the AC_N_AREAS symbol to be the number of distinct areas currently defined for this system. Normally, the buffer parameter supplied to the getaddressconf() function should be large enough to hold information for AC_N_AREAS regions. If buffer is not large enough, the remaining information is truncated. The getaddressconf() call fills in the first AC_N_AREAS records in the user-supplied buffer with the address configuration information for this system, as described above. RETURN VALUES
Upon successful completion, the number of bytes actually written to the user's buffer is returned. If an error occurs, -1 is returned, and errno is set to indicate the error. ERRORS
If the getaddressconf() function fails, errno may be set to the following value: The address specified for buffer is not valid. RELATED INFORMATION
Functions: mmap(2), exec(2), exec_with_loader(2), brk(2) delim off getaddressconf(2)
All times are GMT -4. The time now is 02:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy