LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 04-27-2012, 11:01 PM   #1
jj7
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
System Call Return Values Question


Hi all,
This is my first post but I have been coming to the site for a long time now.

I have a question regarding creating my own system calls in Ubuntu(version 2.6.35).
I have created my system calls and they work perfectly with the exception that when I check the return value for known bad input in my driver file (how I am calling and testing my system calls) I always receive a negative one. I know my system calls are working because when I use the dmesg command I can see what the system calls are returning right before they return.
When I give valid input my return values match with those in my driver file, what I expect, and the values returned from dmesg. Does anyone have any idea what the reason for this is?

Thanks,
-Jeff

sample output:

Output from dmesg:
[ 2030.296446] rmMbox421:
[ 2030.296447] Mailbox ID: 9
[ 2030.296457] Mailbox 9 could not be removed (DNE).
[ 2030.296461] **Remove Mailbox returned -3


Output from proj2Driver.c:
0) Hello World
1) Create Mailbox
2) Remove Mailbox
3) Count Mailbox
4) List Mailbox
5) Send Message
10) Quit

Enter Option: 2

Enter Mailbox ID: 9
Result from rmMbox421: -1
 
Old 04-27-2012, 11:11 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Duplicate thread reported. Original is http://www.linuxquestions.org/questi...values-942193/
 
Old 04-28-2012, 08:32 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Summer Midwest USA, Central Illinois, Winter Central Florida
Distribution: SlackwareŽ
Posts: 13,235
Blog Entries: 29

Rep: Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437
Moderator response

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] System Call Return Values jj7 Linux - Newbie 2 05-04-2012 06:32 PM
system() and return values PatrickNew Programming 1 02-07-2007 05:35 AM
does a system call return value?? docetes Programming 2 03-16-2006 06:40 PM
How to use return values from system functions? kpachopoulos Programming 2 07-30-2004 04:09 AM
How can get values return from a system call quenn Programming 1 09-17-2003 12:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration