public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] Re: Use of __ia64_syscall() - syscall interface
@ 2002-12-16 21:04 David Mosberger
  2002-12-17 14:00 ` Joel GUILLET
  2002-12-17 23:25 ` David Mosberger
  0 siblings, 2 replies; 3+ messages in thread
From: David Mosberger @ 2002-12-16 21:04 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Mon, 16 Dec 2002 17:07:18 +0100 (NFT), Joel GUILLET <Joel.Guillet@bull.net> said:

  Joel> This doesn't compile on a Itanium.  I got a "undefined
  Joel> reference to __ia64_syscall()"

Please use the syscall() routine instead.  The stuff in unistd.h is
for kernel-use only.

	--david


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Linux-ia64] Re: Use of __ia64_syscall() - syscall interface
  2002-12-16 21:04 [Linux-ia64] Re: Use of __ia64_syscall() - syscall interface David Mosberger
@ 2002-12-17 14:00 ` Joel GUILLET
  2002-12-17 23:25 ` David Mosberger
  1 sibling, 0 replies; 3+ messages in thread
From: Joel GUILLET @ 2002-12-17 14:00 UTC (permalink / raw)
  To: linux-ia64

On Mon, 16 Dec 2002, David Mosberger wrote:

> >>>>> On Mon, 16 Dec 2002 17:07:18 +0100 (NFT), Joel GUILLET <Joel.Guillet@bull.net> said:
>
>   Joel> This doesn't compile on a Itanium.  I got a "undefined
>   Joel> reference to __ia64_syscall()"
>
> Please use the syscall() routine instead.  The stuff in unistd.h is
> for kernel-use only.
>
> 	--david
>

Thanks for your reply.

Actually, I had seen before some (lots of) mails (many from you) that
recommands the use of the syscall() interface, but I mis-understood
the message...
The problem is that I got some problems to find documentation about this
interface and made a mix between the kernel and the glibc interfaces.
(I finally found some in glibc/manual/libc.info-43 )

I can see clearly now. (Thanks for help)
So, as I found how to compile my program, I just send here the way
I used the interface, just in case someone would need it. (even, if it's
not the purpose of that mail-list).

***************************************

#ifndef __NR_sched_setaffinity
#ifndef _AFFINITY_H
#define _AFFINITY_H

#if defined(__ia64__)
#define __NR_sched_setaffinity 1231
#define __NR_sched_getaffinity 1232
#endif

#define sched_setaffinity(arg1, arg2, arg3) syscall(__NR_sched_setaffinity, arg1, arg2, arg3)
#define sched_getaffinity(arg1, arg2, arg3) syscall(__NR_sched_getaffinity, arg1, arg2, arg3)

#endif /* __NR_sched_setaffinity */
#endif /* _AFFINITY_H */

***************************************
(...and then just use directly sched_setaffinity in your program !)


Is that clean ?



----------------
 ** Joel **



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Linux-ia64] Re: Use of __ia64_syscall() - syscall interface
  2002-12-16 21:04 [Linux-ia64] Re: Use of __ia64_syscall() - syscall interface David Mosberger
  2002-12-17 14:00 ` Joel GUILLET
@ 2002-12-17 23:25 ` David Mosberger
  1 sibling, 0 replies; 3+ messages in thread
From: David Mosberger @ 2002-12-17 23:25 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Tue, 17 Dec 2002 15:00:49 +0100 (NFT), Joel GUILLET <Joel.Guillet@bull.net> said:

  Joel> Actually, I had seen before some (lots of) mails (many from
  Joel> you) that recommands the use of the syscall() interface, but I
  Joel> mis-understood the message...  The problem is that I got some
  Joel> problems to find documentation about this interface and made a
  Joel> mix between the kernel and the glibc interfaces.  (I finally
  Joel> found some in glibc/manual/libc.info-43 )

Yes, syscall() is documented in the glibc manual.

  Joel> #ifndef __NR_sched_setaffinity
  Joel> #ifndef _AFFINITY_H
  Joel> #define _AFFINITY_H

  Joel> #if defined(__ia64__)
  Joel> #define __NR_sched_setaffinity 1231
  Joel> #define __NR_sched_getaffinity 1232
  Joel> #endif

  Joel> #define sched_setaffinity(arg1, arg2, arg3) syscall(__NR_sched_setaffinity, arg1, arg2, arg3)
  Joel> #define sched_getaffinity(arg1, arg2, arg3) syscall(__NR_sched_getaffinity, arg1, arg2, arg3)

  Joel> #endif /* __NR_sched_setaffinity */
  Joel> #endif /* _AFFINITY_H */

This is basically fine, except that for syscall(), the syscall number macros
by convention start with SYS_*.  So I'd rewrite your code to:

#ifndef SYS_sched_setaffinity
#ifndef _AFFINITY_H
#define _AFFINITY_H

#if defined(__ia64__)
#define SYS_sched_setaffinity 1231
#define SYS_sched_getaffinity 1232
#endif

#define sched_setaffinity(arg1, arg2, arg3) syscall(SYS_sched_setaffinity, arg1, arg2, arg3)
#define sched_getaffinity(arg1, arg2, arg3) syscall(SYS_sched_getaffinity, arg1, arg2, arg3)

#endif /* SYS_sched_setaffinity */
#endif /* _AFFINITY_H */

	--david


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-17 23:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-16 21:04 [Linux-ia64] Re: Use of __ia64_syscall() - syscall interface David Mosberger
2002-12-17 14:00 ` Joel GUILLET
2002-12-17 23:25 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox