Re: unistd.h and 'extern's and 'syscall' "standard(?)"

Andreas Schwab (schwab@suse.de)
01 Apr 2001 21:15:35 +0200


LA Walsh <law@sgi.com> writes:

|> I have a question. Some architectures have "system calls"
|> implemented as library calls (calls that are "system calls" on ia32)
|> For example, the expectation on 'arm', seems to be that sys_sync
|> is in a library. On alpha, sys_open appears to be in a library.
|> Is this correct?
|>
|> Is it the expectation that the library that handles this
|> is the 'glibc' for that platform or is there a special "kernel.lib"
|> that goes with each platform?
|>
|> Is there 1 library that I need to link my apps with to
|> get the 'externs' referenced in "unistd.h"?
|>
|> The reason I ask is that in ia64 the 'syscall' call
|> isn't done with inline assembler but is itself an 'extern' call.
|> This implies that you can't do system calls directly w/o some
|> support library.

Don't use kernel headers in user programs. Just use syscall(3).

Andreas.

-- 
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/