Sponsored Content
Full Discussion: exception handling
Top Forums UNIX for Advanced & Expert Users exception handling Post 52364 by jim mcnamara on Wednesday 16th of June 2004 05:29:03 PM
Old 06-16-2004
Not exactly. The NT family of OSes throw exceptions which are handled by an exception vector. You can throw exceptions -- in the sense of software error trapping in Unix -- using C++ as well. It's no different from MSVC++ in that regard.

Unix creates signals - think of them as exactly like software interrupts -- to handle exceptions. This is not like the Windows message pump.

These signals are sent to a process, which then has a signal handler. It's like an exception vector (table) except that it's a single function that processes signals or lets them through.

On a Unix box, type "man signal" and it will explain a little bit about signal processing.

Here is a site with PDF's that go into some depth (it's for linux, which for signals, is just fine):

www.advancedlinuxprogramming.com

It's a whole book. You're gonna need it. If you're going to non-Linux, try Richard Stevens book 'Advanced Programming in the UNIX Environment'.

Good Luck---

The thing that's going to kill you is that NT(XP) was built from the ground up on threading. Unix was not.

pthreads are supported just fine in most Unix versions, and work well.
 

9 More Discussions You Might Find Interesting

1. Programming

Linux g++ 2.95.3 exception handling

Anybody happen to be familiar with any deficiencies with g++ 2.95.3 regarding exception handling, specifically in multi-threaded / multi-module (shared library) based applications? I'm seeing behavior where thrown exceptions are not caught, but basically ignored causing the application to... (0 Replies)
Discussion started by: earl
0 Replies

2. Shell Programming and Scripting

Exception-handling in Shell programs

Hi all, I am writing a set of scripts and some of these are nested within others. I want to be able to execute a single high-level script at the command-line, which in turn may invoke other scripts as required, and when a failure occurs in any of the nested scripts, I want to be able to track... (2 Replies)
Discussion started by: chaitu_inmage
2 Replies

3. Linux

Handling "command not found" exception

hello friends, I am given a project to handle the command not found exception.I am using RED HAT 9. Generally, when we press a wrong command in the terminal: example :- " $cet " in place of " $cat ". Then we get this exception. But I need to give the output as the combinations that are possible... (5 Replies)
Discussion started by: nsharath
5 Replies

4. Shell Programming and Scripting

Exception Handling

Hi, I have written a script to load csv files into a mysql database, however, i would like for the shell script to exit in the event of an error (missing file, load error etc.) - currently if an error is encountered the next statement is processed - This is how i am loading the csv scripts ... (5 Replies)
Discussion started by: bertpereira
5 Replies

5. Programming

Advanced Exception Handling in C++

Hi Friend, Could you please provide me with some tutorial for Advanced Exception handling in C++, mainly set_terminate() and set_unexpected() functions? Please find the details below: OS: Unix Compiler: gcc. Thanks. :) Awesome001 (0 Replies)
Discussion started by: awesome001
0 Replies

6. Shell Programming and Scripting

Exception handling

Sometimes when I try to use curl to upload to an ftp server, I get the message: $curl -T file.wmv ftp.eu.filesonic.com --user user:password curl: (8) Got a 421 ftp-server response when 220 was expected How do I get the script to try again if I get the message curl: (8)? (2 Replies)
Discussion started by: locoroco
2 Replies

7. Programming

Exception Handling C++

Hello All, I have a question ....which I am totally confused about! If I have a fxn foo in a program which returns a logical value. But it has a posssiblity to throw some exception. Now my exception handler returns a value as a string stating why the exception occured. But my... (1 Reply)
Discussion started by: mind@work
1 Replies

8. Solaris

solaris 7 exception

Hi all, An application works well under 2.6 but under 7 it gives TEXT_IO exceptions. (Is_Open, Check_Is_Open, Get_Line procedures). Any idea? Regards (3 Replies)
Discussion started by: endoavour
3 Replies

9. Shell Programming and Scripting

Monitor logs for exception and if exception come then sent an email

Hi Folks, please advise , I have logs generated on unix machine at location /ops/opt/aaa/bvg.log , now sometimes there come exception in these logs also, so I want to write such a script such that it should continuously monitor these logs and whenever any exception comes that is it try to find... (3 Replies)
Discussion started by: tuntun27272727
3 Replies
floatingpoint.h(3HEAD)						      Headers						    floatingpoint.h(3HEAD)

NAME
floatingpoint.h, floatingpoint - IEEE floating point definitions SYNOPSIS
#include <floatingpoint.h> DESCRIPTION
This file defines constants, types, and functions used to implement standard floating point according to ANSI/IEEE Std 754-1985. The func- tions are implemented in libc. The included header file <sys/ieeefp.h> defines certain types of interest to the kernel. IEEE Rounding Modes fp_direction_type The type of the IEEE rounding direction mode. Note: the order of enumeration varies according to hardware. fp_precision_type The type of the IEEE rounding precision mode, which only applies on systems that support extended precision such as machines based on the Intel 80387 FPU or the 80486. SIGFPE handling: sigfpe_code_type The type of a SIGFPE code. sigfpe_handler_type The type of a user-definable SIGFPE exception handler called to handle a particular SIGFPE code. SIGFPE_DEFAULT A macro indicating the default SIGFPE exception handling, namely to perform the exception handling speci- fied by the user, if any, and otherwise to dump core using abort(3C). SIGFPE_IGNORE A macro indicating an alternate SIGFPE exception handling, namely to ignore and continue execution. SIGFPE_ABORT A macro indicating an alternate SIGFPE exception handling, namely to abort with a core dump. IEEE Exception Handling N_IEEE_EXCEPTION The number of distinct IEEE floating-point exceptions. fp_exception_type The type of the N_IEEE_EXCEPTION exceptions. Each exception is given a bit number. fp_exception_field_type The type intended to hold at least N_IEEE_EXCEPTION bits corresponding to the IEEE exceptions numbered by fp_exception_type. Thus fp_inexact corresponds to the least significant bit and fp_invalid to the fifth least significant bit. Note: some operations may set more than one exception. IEEE Formats and Classification single;extended;quadruple Definitions of IEEE formats. fp_class_type An enumeration of the various classes of IEEE values and symbols. IEEE Base Conversion The functions described under floating_to_decimal(3C) and decimal_to_floating(3C) satisfy not only the IEEE Standard, but also the stricter requirements of correct rounding for all arguments. DECIMAL_STRING_LENGTH The length of a decimal_string. decimal_string The digit buffer in a decimal_record. decimal_record The canonical form for representing an unpacked decimal floating-point number. decimal_form The type used to specify fixed or floating binary to decimal conversion. decimal_mode A struct that contains specifications for conversion between binary and decimal. decimal_string_form An enumeration of possible valid character strings representing floating-point numbers, infinities, or NaNs. FILES
/usr/include/sys/ieeefp.h SEE ALSO
abort(3C), decimal_to_floating(3C), econvert(3C), floating_to_decimal(3C), sigfpe(3C), string_to_decimal(3C), strtod(3C) SunOS 5.10 5 Mar 1993 floatingpoint.h(3HEAD)
All times are GMT -4. The time now is 03:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy