LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   System Call Return Values Question (https://www.linuxquestions.org/questions/linux-general-1/system-call-return-values-question-942197/)

jj7 04-27-2012 10:01 PM

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

catkin 04-27-2012 10:11 PM

Duplicate thread reported. Original is http://www.linuxquestions.org/questi...values-942193/

onebuck 04-28-2012 07:32 AM

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.


All times are GMT -5. The time now is 10:05 PM.