The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > UNIX and Linux Applications
.
google unix.com



UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How do you Sum UNIX return codes z1tt45uuprs7 UNIX for Dummies Questions & Answers 3 10-18-2006 11:46 AM
how to write c codes in UNIX rraajjiibb High Level Programming 12 02-02-2006 12:41 AM
pSeries 610 error codes dangral AIX 2 11-15-2005 06:33 PM
GNU's make error codes - list vino UNIX for Advanced & Expert Users 1 06-30-2005 12:47 PM
Printing Problems in unix ... ( Bar-cdoe - Ip Printing) QuickSilver UNIX for Advanced & Expert Users 3 06-04-2002 10:48 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-07-2009
vijaya2006 vijaya2006 is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 25
Question Printing unix error codes

Hi Friends,

I need your help in understanding this:

I want to print the error numbers returned by the system calls (not the actual integers but the strings that they match to). The error numbers like EACCESS, ENOMEM, ENOENT etc ...

For eg:
Code:
returnCode = open(somefile, O_RDONLY);

if (returnCode < 0) {

/* Handle the error */

printf("Error %d occured\n",errno);

}
>>>>This will print the error number in terms of integer. I want to get exactly the error code ( EACCESS, or ENOMEM ) etc ..

Thanks in Advance

Last edited by pludi; 10-07-2009 at 03:31 PM.. Reason: code tags, please...
  #2 (permalink)  
Old 10-07-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,839
You might want to take a look at perror

Last edited by pludi; 3 Weeks Ago at 07:53 AM..
  #3 (permalink)  
Old 10-07-2009
فارس الأحزان فارس الأحزان is offline
Banned
  
 

Join Date: Oct 2009
Posts: 8
very thanks vijaya2006
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:45 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0