LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-11-2006, 05:19 AM   #1
havokdrums
LQ Newbie
 
Registered: Nov 2006
Posts: 1

Rep: Reputation: 0
__syscall_return macro in unistd.h


I have a question about the __syscall_return macro, in include/asm-i386/unistd.h :

/*
* user-visible error numbers are in the range -1 - -128: see
* <asm-i386/errno.h>
*/

#define __syscall_return(type, res) \
do { \
if ((unsigned long)(res) >= (unsigned long)(-(128 + 1)) {\
errno = -(res); \
res = -1; \
} \
return (type) (res); \
} while (0)


My question is: if the system call returned -129, errno will be set to 129, which, as the commment says, is not a legal value (i.e. the value 129 is not defined for errno in errno.h).
Can someone please explain me why the test is >= -(128+1) instead of >= -128 ?
Thank you.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OO 2.0 and macro LinxNew SUSE / openSUSE 1 02-06-2006 10:24 PM
#defining a macro inside a macro? saravkrish Programming 1 05-24-2005 09:48 PM
about DO_COMPRESS macro haodongdong Programming 0 05-07-2005 04:43 AM
macro linuxanswer Programming 1 11-17-2003 03:58 PM
AM_PATH_GTK macro isajera Linux - Software 1 08-16-2001 01:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:19 PM.

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
Open Source Consulting | Domain Registration