Sponsored Content
Top Forums UNIX for Advanced & Expert Users exec to call specific function in C prog Post 302201605 by vpraveen84 on Monday 2nd of June 2008 04:06:42 PM
Old 06-02-2008
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
 

10 More Discussions You Might Find Interesting

1. Programming

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... (2 Replies)
Discussion started by: a25khan
2 Replies

2. Shell Programming and Scripting

How can I execute own ksh function in find -exec

Hi, I wrote a smiple ksh function send_notification() { ... } and want to execute it on each file, matched by the find command. I tried: find / -name "*.err" -mtime -8 -exec send_notification {} \; but it doesn't work. What should I do? I work in ksh on Hp-Ux. Regards, Pit (11 Replies)
Discussion started by: piooooter
11 Replies

3. Shell Programming and Scripting

How to call a Linux command in C prog.

Dear Friends, I want to know how to call a Linux commands in C programs. (1 Reply)
Discussion started by: krishna_sicsr
1 Replies

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

5. Programming

Runtime.getSystem.exec() function waits for child

Runtime.getSystem.exec() waits for child process to complete .. I do not want to wait for the child process to complete ..what is the option which has to be used ? (2 Replies)
Discussion started by: shafi2all
2 Replies

6. Shell Programming and Scripting

how to call java prog from shell script

I have a java program to validate a XML file. I want to call this java program in a shell script which will be registered as concurrent program in oracle apps. Can anyone please let me know the step by step appraoch required to call java program in shell script like ....intial steps... (1 Reply)
Discussion started by: kcp_pavan
1 Replies

7. Infrastructure Monitoring

diffrence between method call and function call in perl

Hello, I have a problem with package and name space. require "/Mehran/DSGateEngineLib/general.pl"; use strict; sub System_Status_Main_Service_Status_Intrusion_Prevention { my %idpstatus; my @result; &General_ReadHash("/var/dsg/idp/settings",\%idpstatus); #print... (4 Replies)
Discussion started by: Zaxon
4 Replies

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

9. Shell Programming and Scripting

After exit from function it should not call other function

Below is my script that is function properly per my conditions but I am facing one problem here that is when one function fails then Iy should not check other functions but it calls the other function too So anyone can help me how could i achieve this? iNOUT i AM GIVING TO THE... (1 Reply)
Discussion started by: rohit22hamirpur
1 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
getexeccon(3)						     SELinux API documentation						     getexeccon(3)

NAME
getexeccon, setexeccon - get or set the SELinux security context used for executing a new process. rpm_execcon - run a helper for rpm in an appropriate security context SYNOPSIS
#include <selinux/selinux.h> int getexeccon(security_context_t *context); int setexeccon(security_context_t context); int rpm_execcon(unsigned int verified, const char *filename, char *const argv[] , char *const envp[]); DESCRIPTION
getexeccon retrieves the context used for executing a new process. This returned context should be freed with freecon if non-NULL. getex- eccon sets *con to NULL if no exec context has been explicitly set by the program (i.e. using the default policy behavior). setexeccon sets the context used for the next execve call. NULL can be passed to setexeccon to reset to the default policy behavior. The exec context is automatically reset after the next execve, so a program doesn't need to explicitly sanitize it upon startup. setexeccon can be applied prior to library functions that internally perform an execve, e.g. execl*, execv*, popen, in order to set an exec context for that operation. Note: Signal handlers that perform an execve must take care to save, reset, and restore the exec context to avoid unexpected behavior. rpm_execcon runs a helper for rpm in an appropriate security context. The verified parameter should contain the return code from the sig- nature verification (0 == ok, 1 == notfound, 2 == verifyfail, 3 == nottrusted, 4 == nokey), although this information is not yet used by the function. The function determines the proper security context for the helper based on policy, sets the exec context accordingly, and then executes the specified filename with the provided argument and environment arrays. RETURN VALUE
On error -1 is returned. On success getexeccon and setexeccon returns 0. rpm_execcon only returns upon errors, as it calls execve(2). SEE ALSO
selinux(8), freecon(3), getcon(3) russell@coker.com.au 1 January 2004 getexeccon(3)
All times are GMT -4. The time now is 03:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy