Sponsored Content
Top Forums Programming Writing c code for who | sort | lp Post 302123715 by porter on Tuesday 26th of June 2007 10:08:00 PM
Old 06-26-2007
Quote:
Originally Posted by the_learner
But for some cases, if I leave some of the close statements in there.. it seems to work..
If you need it working, then use the working version.

Quote:
Originally Posted by the_learner
But I need to get this done urgently Smilie Porter please help...
Deadline approaching?

By the way, you must cope with execXX() failing. If the program is not found execlp (or whatever) will return. Follow it with _exit(1); as follows...

Code:
execlp(.....);
/* ERROR: could not find or run program */
_exit(1);

Using _exit would allow you to use vfork later.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

conditional writing of sql code

Hello again... I have a request from another department to list for them all the columns and tables we use in this certain database. I have spooled the oracle stored procedured into 1 file. I need a way to write out parts of that file. The criteria is to to start the block to be written when... (0 Replies)
Discussion started by: kburrows
0 Replies

2. Shell Programming and Scripting

writing code!!!

suppose by writing this code "$ /sbin/ifconfig eth0| grep 'inet addr:' " i've got this output "inet addr:192.168.2.1 Mask:255.255.255.0" now if i want to see the output like this "IP address: 192.168.2.1 Subnet Mask: 255.255.255.0" what is the code should be? can anyone... (3 Replies)
Discussion started by: shelly
3 Replies

3. Shell Programming and Scripting

Help in writing the code

hi i am studying unix with c language ,and completely new to this .I have question about how to pass the control from one program file to another.My first program has the main process and it should go into the second program where i can create six processes with also the usage of pipes to... (3 Replies)
Discussion started by: soumya_v7
3 Replies

4. Shell Programming and Scripting

script or piece of code where the data returned by a stored procedure you are writing

hi fndz. Can you please help me with the code if I call a stored procedure from my shell script and stored procedure returns a cursor, cursor output should be saved to a file (3 Replies)
Discussion started by: enigma_83
3 Replies

5. Homework & Coursework Questions

Writing Code

1. The problem statement, all variables and given/known data: Write a script that will perform the grep command on a user defined file and a user defined pattern 2. Relevant commands, code, scripts, algorithms: must use grep command (that is the only piece of information that was given) ... (2 Replies)
Discussion started by: akjim101
2 Replies

6. Programming

Vi question for writing source code

Hi guys, I'm modifying an old f77 code using vi. I'm modifying the code remotely from my windows machine using xming using vi. I'm using tabs to move past the first 6 columns of the code and to keep my loops and if statements neat, but when I hit the tab key, vi displays a big red block which is... (7 Replies)
Discussion started by: rks171
7 Replies

7. UNIX for Dummies Questions & Answers

sed remove two headers; writing more elegant code

Hi there, I have two questions. First, I was wondering how to use sed to remove two header lines or two tail lines. Here I just do the same operation twice...I'm sure there is a better way. Second, and more importantly, is there a better way to have these operations use files other than... (5 Replies)
Discussion started by: mikey11415
5 Replies

8. Shell Programming and Scripting

Sort error code 512

Hi Friends, I am back with small issue which i tried thinking but could not get much!!!! issue here is..i m using kind of extraction query using perl code in that i do sort with few number of csv files. each of them will be around 50 to 100 M size. sometime i get following error message... (1 Reply)
Discussion started by: Shahul
1 Replies

9. Shell Programming and Scripting

Writing a UNIX script from LOG to provide return code.

Folks - Firstly, I do apologize that my first post here is a question. I am quite familiar with UNIX since our application is running on it. We are trying to automate a few things on our end and I am challenged with a task in hand that requires UNIX scripting. I am totally a newbie in UNIX... (4 Replies)
Discussion started by: sk72
4 Replies

10. Shell Programming and Scripting

Help writing code

Hi, i need a string that take from a log file just two words (ngwan0) and his related ip address and then execute 2 commands in a shell. Any ideas where to start? Thanks (3 Replies)
Discussion started by: Board27
3 Replies
_EXIT(2)						     Linux Programmer's Manual							  _EXIT(2)

NAME
_exit, _Exit - terminate the current process SYNOPSIS
#include <unistd.h> void _exit(int status); #include <stdlib.h> void _Exit(int status); DESCRIPTION
The function _exit terminates the calling process "immediately". Any open file descriptors belonging to the process are closed; any chil- dren of the process are inherited by process 1, init, and the process's parent is sent a SIGCHLD signal. The value status is returned to the parent process as the process's exit status, and can be collected using one of the wait family of calls. The function _Exit is equivalent to _exit. RETURN VALUE
These functions do not return. CONFORMING TO
SVr4, SVID, POSIX, X/OPEN, BSD 4.3. The function _Exit() was introduced by C99. NOTES
For a discussion on the effects of an exit, the transmission of exit status, zombie processes, signals sent, etc., see exit(3). The function _exit is like exit(), but does not call any functions registered with the ANSI C atexit function, nor any registered signal handlers. Whether it flushes standard I/O buffers and removes temporary files created with tmpfile(3) is implementation-dependent. On the other hand, _exit does close open file descriptors, and this may cause an unknown delay, waiting for pending output to finish. If the delay is undesired, it may be useful to call functions like tcflush() before calling _exit(). Whether any pending I/O is cancelled, and which pending I/O may be cancelled upon _exit(), is implementation-dependent. SEE ALSO
fork(2), execve(2), waitpid(2), wait4(2), kill(2), wait(2), exit(3), termios(3) Linux 2001-11-17 _EXIT(2)
All times are GMT -4. The time now is 03:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy