public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* INTERNAL_SYSCALL and function calls in arguments
@ 2004-04-09  7:15 Thorsten Kukuk
  2004-04-09 13:45 ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Thorsten Kukuk @ 2004-04-09  7:15 UTC (permalink / raw)
  To: libc-hacker


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

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

end of thread, other threads:[~2004-04-16 19:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-09  7:15 INTERNAL_SYSCALL and function calls in arguments Thorsten Kukuk
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

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).