Macro question

Hi guys I recently asked a question about unistd.h


anyway reading through it I can't decipher what the macros are doing

1
2
3
4
5
6
7

#include <asm/bitsperlong.h>

#ifndef __SYSCALL
#define __SYSCALL(x,y)
#endif


these are just the first few lines obviously the header contains 100's of lines,I have an understanding of macros and how they can be used,but I don't understand what __SYSCAMM is been defined for? we are defining __SYSCALL(x,y) as a macro but what for? there is nothing after __SYSCALL(x,y)

I checked in bitsperlong.h and thought maybe it was defined in there but nope

thanks
You need to provide a link to the actual code.

The define you show is just defining __SYSCALL(x,y) to be an empty function-like macro. Otherwise anywhere it says __SYSCALL(foo, bar) later it won't be illegal. Exactly why they are doing that would require a perusal of the actual header file that you are looking at since we don't know what system you are on.
I'm using a ubuntu 64 bit vm,

the above lines of code are pretty much the start of the header file there is no other code before this other than a few comments

I can't see how __SYSCALL(x,y) is being defined with anything
Exactly, it's being defined to nothing (unless it's already defined).
You've got your hands on the wrong unistd.h file. That's a lower-level one and would be included by something that would usually define __SYSCALL (which is assembly and so would be different for different architectures).

The unistd.h that you normally include doesn't expose that low-level interface at all. It's just /usr/include/unistd.h
Topic archived. No new replies allowed.