Sponsored Content
Top Forums Programming after executing execvp()... program hangs up Post 302089159 by Crab on Sunday 17th of September 2006 09:50:38 PM
Old 09-17-2006
Sorry for the Typo...but i hav commented the open()

BTW it wasnt giving any system error...dunno kno how Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Allowing a script to continue executing when a command hangs

Hello all, I'm writing a script in c-shell that, among other things, queries information from another system. Is there a graceful way I can continue execution of the script if that query command(rup) causes the script to hang? Thanks much! (5 Replies)
Discussion started by: mkinney
5 Replies

2. Programming

executing a program within a program

Read the title: how do i do it? (4 Replies)
Discussion started by: Gekko
4 Replies

3. Shell Programming and Scripting

Executing a Java Program

I am entirely new to shell scripting and would like to create a script to execute a java program called Main. I've already compiled it and placed the .java and .class files at /root/javaTest. Next I made a shell script that simply contained: java /root/javaTest/Main . I made the script... (2 Replies)
Discussion started by: hypnotic_meat
2 Replies

4. Programming

popen hangs program during cmd execution

How can I get around this? when my program reaches the following popen job it halts the program until the ping/netstat/ipconfig/traceroute is completed then resume to the rest of the program... FILE *in; extern FILE *popen(); char buff; char newline; char nstat; char nping; ... (5 Replies)
Discussion started by: Jess83
5 Replies

5. Shell Programming and Scripting

Executing WIN32OLE program

Hello, Please help me out to execute this perl program: #!/usr/bin/perl -w use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # die on errors... # get already active Excel application or open new my... (6 Replies)
Discussion started by: suvenduperl
6 Replies

6. UNIX for Dummies Questions & Answers

executing a different program

What system calls or commands do I need to use in order to execute a different program from an already running process? (1 Reply)
Discussion started by: justOne21
1 Replies

7. Shell Programming and Scripting

How to display a message if program hangs(takes too long)

I have a ksh script (script1) that calls another ksh script (script2). If script2.ksh hangs or takes too long to execute I want script1.ksh to kill the call to script2.ksh and instead just display "Script2 can't run right now". Could someone help me with coding this? (1 Reply)
Discussion started by: mrskittles99
1 Replies

8. Programming

Error in executing the C program

Hello Friends, I have written a code for the unisex bathroom which makes a policy that when a woman is in the bathroom only other women may enter, but not men, and vice versa. This program consists of four functions which a user defines but these functions are not properly working while... (4 Replies)
Discussion started by: Ravi Tej
4 Replies

9. Programming

Program Hangs

I have two programs, DriverScale.c and scale9.c. DriverScale.c calls scale 9.c which sends a W and a carraige return to the scale which SHOULD return the weight to DriverScale. However scale 9 hangs for at least 10 min, and then finally returns the weight. Compilation: ... (8 Replies)
Discussion started by: Meow613
8 Replies

10. Programming

Fork and Execvp Not Executing Bash Commands From C correctly.

I had been looking at page 75 of this online book: http://richard.esplins.org/static/downloads/linux_book.pdf I've used the system function in C to call bash commands before, but wanted to learn this way too. The solution in the book worked perfectly. However, I tried changing the simple "ls -l... (3 Replies)
Discussion started by: Azrael
3 Replies
explain_execvp(3)					     Library Functions Manual						 explain_execvp(3)

NAME
explain_execvp - explain execvp(3) errors SYNOPSIS
#include <libexplain/execvp.h> const char *explain_execvp(const char *pathname, char *const *argv); const char *explain_errno_execvp(int errnum, const char *pathname, char *const *argv); void explain_message_execvp(char *message, int message_size, const char *pathname, char *const *argv); void explain_message_errno_execvp(char *message, int message_size, int errnum, const char *pathname, char *const *argv); DESCRIPTION
These functions may be used to obtain explanations for errors returned by the execvp(3) system call. explain_execvp const char *explain_execvp(const char *pathname, char *const *argv); The explain_execvp function is used to obtain an explanation of an error returned by the execvp(3) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: if (execvp(pathname, argv) < 0) { fprintf(stderr, "%s ", explain_execvp(pathname, argv)); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_execvp_or_die(3) function. pathname The original pathname, exactly as passed to the execvp(3) system call. argv The original argv, exactly as passed to the execvp(3) system call. Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_errno_execvp const char *explain_errno_execvp(int errnum, const char *pathname, char *const *argv); The explain_errno_execvp function is used to obtain an explanation of an error returned by the execvp(3) system call. The least the mes- sage will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: if (execvp(pathname, argv) < 0) { int err = errno; fprintf(stderr, "%s ", explain_errno_execvp(err, pathname, argv)); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_execvp_or_die(3) function. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pathname The original pathname, exactly as passed to the execvp(3) system call. argv The original argv, exactly as passed to the execvp(3) system call. Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_message_execvp void explain_message_execvp(char *message, int message_size, const char *pathname, char *const *argv); The explain_message_execvp function may be used to obtain an explanation of an error returned by the execvp(3) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: if (execvp(pathname, argv) < 0) { char message[3000]; explain_message_execvp(message, sizeof(message), pathname, argv); fprintf(stderr, "%s ", message); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_execvp_or_die(3) function. message The location in which to store the returned message. If a suitable message return buffer is supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. pathname The original pathname, exactly as passed to the execvp(3) system call. argv The original argv, exactly as passed to the execvp(3) system call. explain_message_errno_execvp void explain_message_errno_execvp(char *message, int message_size, int errnum, const char *pathname, char *const *argv); The explain_message_errno_execvp function may be used to obtain an explanation of an error returned by the execvp(3) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: if (execvp(pathname, argv) < 0) { int err = errno; char message[3000]; explain_message_errno_execvp(message, sizeof(message), err, pathname, argv); fprintf(stderr, "%s ", message); exit(EXIT_FAILURE); } The above code example is available pre-packaged as the explain_execvp_or_die(3) function. message The location in which to store the returned message. If a suitable message return buffer is supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pathname The original pathname, exactly as passed to the execvp(3) system call. argv The original argv, exactly as passed to the execvp(3) system call. SEE ALSO
execvp(3) execute a file explain_execvp_or_die(3) execute a file and report errors COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller explain_execvp(3)
All times are GMT -4. The time now is 11:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy