From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] Re: Use of __ia64_syscall() - syscall interface
Date: Tue, 17 Dec 2002 23:25:38 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590709805604@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590709805572@msgid-missing>
>>>>> 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
prev parent reply other threads:[~2002-12-17 23:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590709805604@msgid-missing \
--to=davidm@napali.hpl.hp.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox