public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Thorsten Kukuk <kukuk@suse.de>
To: libc-hacker@sources.redhat.com
Subject: INTERNAL_SYSCALL and function calls in arguments
Date: Fri, 09 Apr 2004 07:15:00 -0000	[thread overview]
Message-ID: <20040409071510.GA21965@suse.de> (raw)


Hi,

sched_setaffinity has the following code:

INTERNAL_SYSCALL (sched_getaffinity, err, 3, getpid(), psize, p)


On AMD64, the INTERNAL_SYSCALL macro does not work if you make a
function call as argument. As result, the sched_getaffinity syscall
will always fail.

Is this a bug in the macro, or is the usage wrong at this place? As
far as I can see, this is the only place where we use such a
construct.

  Thorsten


2004-04-09  Thorsten Kukuk  <kukuk@suse.de>

	* sysdeps/unix/sysv/linux/sched_setaffinity.c: Don't pass function
	call as argument to INTERNAL_SYSCALL.

--- ./sysdeps/unix/sysv/linux/sched_setaffinity.c	29 Mar 2004 21:59:17 -0000	1.4
+++ ./sysdeps/unix/sysv/linux/sched_setaffinity.c	9 Apr 2004 07:11:15 -0000
@@ -40,8 +40,9 @@
 
       size_t psize = 128;
       void *p = alloca (psize);
+      pid_t mypid = getpid ();
 
-      while (res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, getpid (),
+      while (res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, mypid,
 				     psize, p),
 	     INTERNAL_SYSCALL_ERROR_P (res, err)
 	     && INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE Linux AG        Maxfeldstr. 5                 D-90409 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B

             reply	other threads:[~2004-04-09  7:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-09  7:15 Thorsten Kukuk [this message]
2004-04-09 13:45 ` Andreas Schwab
2004-04-10  7:34   ` Andreas Jaeger
2004-04-13 12:54     ` Kaz Kojima
2004-04-16 19:07       ` Ulrich Drepper
2004-04-10 16:50   ` Ulrich Drepper
2004-04-10 18:38     ` Andreas Schwab
2004-04-10 19:11       ` Ulrich Drepper
2004-04-10 22:04         ` Andreas Schwab
2004-04-13  0:28   ` Ulrich Drepper

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=20040409071510.GA21965@suse.de \
    --to=kukuk@suse.de \
    --cc=libc-hacker@sources.redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).