From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9133 invoked by alias); 9 Apr 2004 07:35:59 -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 9116 invoked from network); 9 Apr 2004 07:35:58 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sources.redhat.com with SMTP; 9 Apr 2004 07:35:58 -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 69026420011 for ; Fri, 9 Apr 2004 09:35:57 +0200 (CEST) Received: from aj by arthur.inka.de with local (Exim 4.22) id 1BBqY2-0003SW-GP for libc-hacker@sources.redhat.com; Fri, 09 Apr 2004 09:35:34 +0200 To: Glibc hackers Subject: fix sched_setaffinity From: Andreas Jaeger Date: Fri, 09 Apr 2004 07:35:00 -0000 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Rational FORTRAN, linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2004-04/txt/msg00015.txt.bz2 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 1461 We cannot use a function call inside INTERNAL_SYSCALL, the macro does not expands its arguments correctly. This has been noticed on x86-64 (thanks Andreas Schwab and Thorsten Kukuk) but it should be a problem on other architectures also. Ok to commit the appended patch? Andreas 2004-04-09 Andreas Jaeger * sysdeps/unix/sysv/linux/sched_setaffinity.c (__sched_setaffinity_new): Do not use a call in INTERNAL_SYSCALL. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Index: sysdeps/unix/sysv/linux/sched_setaffinity.c --- 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:30:29 -0000 @@ -40,8 +40,9 @@ __sched_setaffinity_new (pid_t pid, size =20 size_t psize =3D 128; void *p =3D alloca (psize); + pid_t pid =3D getpid (); =20 - while (res =3D INTERNAL_SYSCALL (sched_getaffinity, err, 3, getpid (= ), + while (res =3D INTERNAL_SYSCALL (sched_getaffinity, err, 3, pid, psize, p), INTERNAL_SYSCALL_ERROR_P (res, err) && INTERNAL_SYSCALL_ERRNO (res, err) =3D=3D EINVAL) --=20 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj SuSE Linux AG, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GPG fingerprint =3D 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 --=-=-= Content-Type: application/pgp-signature Content-length: 188 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQBAdlJFOJpWPMJyoSYRAo4aAKCAaLR4ugPpJ1dpgn91nkHfEDPaEACeO9bT DtDQdA9e+yO7nFRFz46POgQ= =rSwd -----END PGP SIGNATURE----- --=-=-=--