Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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?
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
To me, the question isn't clear enough.
What do you expect as a result when you give a bad input?
What is the system call supposed to do?
Can you post some source code of the system call here for
others to look?
Hey, Thanks for the response. I have figured out my problem, whenever my system call returned it was always negative one indicated there was an error. My solution was saved the errno value and if the return value was negative one I then checked the errno to see what specific error had occurred. Thanks a bunch,