From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3908 invoked by alias); 9 Apr 2004 07:15:12 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 3886 invoked from network); 9 Apr 2004 07:15:11 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sources.redhat.com with SMTP; 9 Apr 2004 07:15:11 -0000 Received: from hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 9FC00420109 for ; Fri, 9 Apr 2004 09:15:10 +0200 (CEST) Date: Fri, 09 Apr 2004 07:15:00 -0000 From: Thorsten Kukuk To: libc-hacker@sources.redhat.com Subject: INTERNAL_SYSCALL and function calls in arguments Message-ID: <20040409071510.GA21965@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Organization: SuSE Linux AG, Nuernberg, Germany X-SW-Source: 2004-04/txt/msg00014.txt.bz2 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 * 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