From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by sourceware.org (Postfix) with ESMTPS id 9D212386183F for ; Tue, 20 Jul 2021 08:56:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9D212386183F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=denx.de Received: from ktm (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 6820182C0D; Tue, 20 Jul 2021 10:56:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1626771405; bh=XrwLZcouKgaqYpMi6pmgtjz2RqsX1lJD2Peu1heZbMw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qp/N+QlFBANRDHYVfyXyN+A6EqzpNyQ/39wzTLTqEv9Ubo1HiVIUlnDbcq3Ph5cwH zJoKgCAxe8XxcbU9EEEIPz5ywhMpiFcUshfJNnLU25z6pUANyC9xIQFbKZcwJ6bHJR wUYutr9oBUSno8+I27JLeiyW0lLMp/XIGWfkbrAPW9LvUJNA5gTy2twYuPnQBxyxH6 IKg96jshaja3vo5IGty7zXCFJi4HH44LdDg8+pFCNDzhtVyjJyLq8FoVJiQ54Cgatl 964B9tuojsJZtd0I3/UbsG5uPrMV2KnGnby0ObazolAZ7i75iJ/9O0oc4f/WqVKUJT ROgOqI1KZ6rQg== Date: Tue, 20 Jul 2021 10:56:44 +0200 From: Lukasz Majewski To: Florian Weimer via Libc-alpha Cc: Florian Weimer , libc-alpha@sourceware.org Subject: Re: [PATCH 4/8] socket: Add time64 alias for sendmmsg Message-ID: <20210720105644.0d2c7e36@ktm> In-Reply-To: <2da65ac5bceca941853ff51af8f8e677bcf96546.1625492203.git.fweimer@redhat.com> References: <2da65ac5bceca941853ff51af8f8e677bcf96546.1625492203.git.fweimer@redhat.com> Organization: denx.de X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/g+26=ZgjQj+ZriV6vHrwLFJ"; protocol="application/pgp-signature" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 08:56:49 -0000 --Sig_/g+26=ZgjQj+ZriV6vHrwLFJ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 05 Jul 2021 15:42:08 +0200 Florian Weimer via Libc-alpha wrote: > --- > socket/sys/socket.h | 14 +- > sysdeps/unix/sysv/linux/Makefile | 4 +- > sysdeps/unix/sysv/linux/Versions | 1 + > sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 + > sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 + > sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + > sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + > sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + > .../sysv/linux/m68k/coldfire/libc.abilist | 1 + > .../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + > .../sysv/linux/microblaze/be/libc.abilist | 1 + > .../sysv/linux/microblaze/le/libc.abilist | 1 + > .../sysv/linux/mips/mips32/fpu/libc.abilist | 1 + > .../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + > .../sysv/linux/mips/mips64/n32/libc.abilist | 1 + > sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 + > .../linux/powerpc/powerpc32/fpu/libc.abilist | 1 + > .../powerpc/powerpc32/nofpu/libc.abilist | 1 + > .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 + > sysdeps/unix/sysv/linux/sendmmsg.c | 3 + > sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 + > sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 + > .../sysv/linux/sparc/sparc32/libc.abilist | 1 + > .../unix/sysv/linux/tst-scm_rights-time64.c | 1 + > sysdeps/unix/sysv/linux/tst-scm_rights.c | 186 > ++++++++++++++++++ 25 files changed, 226 insertions(+), 2 deletions(-) > create mode 100644 sysdeps/unix/sysv/linux/tst-scm_rights-time64.c > create mode 100644 sysdeps/unix/sysv/linux/tst-scm_rights.c >=20 > diff --git a/socket/sys/socket.h b/socket/sys/socket.h > index 5577e75b80..d02d976bb5 100644 > --- a/socket/sys/socket.h > +++ b/socket/sys/socket.h > @@ -179,9 +179,21 @@ extern ssize_t sendmsg (int __fd, const struct > msghdr *__message,=20 > This function is a cancellation point and therefore not marked > with __THROW. */ > +# ifndef __USE_TIME_BITS64 > extern int sendmmsg (int __fd, struct mmsghdr *__vmessages, > unsigned int __vlen, int __flags); > -#endif > +# else > +# ifdef __REDIRECT > +extern int __REDIRECT (sendmmsg, (int __fd, struct mmsghdr > *__vmessages, > + unsigned int __vlen, int __flags), > + __sendmmsg64); > +# else > +extern int __sendmmsg64 (int __fd, struct mmsghdr *__vmessages, > + unsigned int __vlen, int __flags); > +# define sendmmsg __sendmmsg64 > +# endif > +# endif /* __USE_TIME_BITS64 */ > +#endif /* __USE_GNU */ > =20 > /* Receive a message as described by MESSAGE from socket FD. > Returns the number of bytes read or -1 for errors. > diff --git a/sysdeps/unix/sysv/linux/Makefile > b/sysdeps/unix/sysv/linux/Makefile index 6fe358cecc..cd13ab4e6a 100644 > --- a/sysdeps/unix/sysv/linux/Makefile > +++ b/sysdeps/unix/sysv/linux/Makefile > @@ -116,7 +116,8 @@ tests +=3D tst-clone tst-clone2 tst-clone3 > tst-fanotify tst-personality \ tst-tgkill tst-sysvsem-linux > tst-sysvmsg-linux tst-sysvshm-linux \ tst-timerfd tst-ppoll \ > tst-clock_adjtime tst-adjtimex tst-ntp_adjtime > tst-ntp_gettime \ > - tst-ntp_gettimex tst-sigtimedwait tst-misalign-clone > tst-prctl > + tst-ntp_gettimex tst-sigtimedwait tst-misalign-clone > tst-prctl \ > + tst-scm_rights > =20 > # Test for the symbol version of fcntl that was replaced in glibc > 2.28. ifeq ($(have-GLIBC_2.27)$(build-shared),yesyes) > @@ -135,6 +136,7 @@ tests-time64 +=3D \ > tst-sigtimedwait-time64 \ > tst-timerfd-time64 \ > tst-prctl-time64 \ > + tst-scm_rights-time64 \ > # tests-time64 > =20 > CFLAGS-tst-sigcontext-get_pc.c =3D -fasynchronous-unwind-tables > diff --git a/sysdeps/unix/sysv/linux/Versions > b/sysdeps/unix/sysv/linux/Versions index 97e1e81801..0fc5d59608 100644 > --- a/sysdeps/unix/sysv/linux/Versions > +++ b/sysdeps/unix/sysv/linux/Versions > @@ -265,6 +265,7 @@ libc { > __semctl64; > __semtimedop64; > __sem_timedwait64; > + __sendmmsg64; > __setitimer64; > __settimeofday64; > __shmctl64; > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist > b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index > 06deef986f..6654462ff2 100644 --- > a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ > b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -268,6 +268,7 @@ > GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist > b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index > cb5a95ebb9..e4f66ebad8 100644 --- > a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ > b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -265,6 +265,7 @@ > GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist > b/sysdeps/unix/sysv/linux/csky/libc.abilist index > 76a1898218..b145b90667 100644 --- > a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ > b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2400,6 +2400,7 @@ > GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist > b/sysdeps/unix/sysv/linux/hppa/libc.abilist index > cb135fe6ca..2fcd2408ee 100644 --- > a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ > b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2353,6 +2353,7 @@ > GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist > b/sysdeps/unix/sysv/linux/i386/libc.abilist index > 8941056337..9876c4fccc 100644 --- > a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ > b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2537,6 +2537,7 @@ > GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist > b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index > 7cec07ea16..1db5f6ac97 100644 --- > a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ > b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -269,6 +269,7 > @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist > b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index > edc488fe98..9ff084727a 100644 --- > a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ > b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2480,6 +2480,7 > @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist > b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index > b382d9b268..9bf0dc86d3 100644 --- > a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ > b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2451,6 > +2451,7 @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 > __sem_timedwait64 F GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist > b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index > 75752d1400..6eca8d3e65 100644 --- > a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ > b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2448,6 > +2448,7 @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 > __sem_timedwait64 F GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist > b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index > e362490afb..3e10357c37 100644 --- > a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ > b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2445,6 > +2445,7 @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 > __sem_timedwait64 F GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist > b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index > d2eba312a7..40def98ca7 100644 --- > a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ > b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2443,6 > +2443,7 @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 > __sem_timedwait64 F GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist > b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index > ec5d956d0c..21decc1ba4 100644 --- > a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ > b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2451,6 > +2451,7 @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 > __sem_timedwait64 F GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist > b/sysdeps/unix/sysv/linux/nios2/libc.abilist index > 5ffbab4d4c..c4a1d8f8dd 100644 --- > a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ > b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2490,6 +2490,7 @@ > GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git > a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist > b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index > d4ba30a441..3afedd33c3 100644 --- > a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ > b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ > -2507,6 +2507,7 @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 > __sem_timedwait64 F GLIBC_2.34 __semctl64 F GLIBC_2.34 __semtimedop64 > F +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git > a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist > b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index > 8eb206d36e..3d0366c7d5 100644 --- > a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ > b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ > -2540,6 +2540,7 @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 > __sem_timedwait64 F GLIBC_2.34 __semctl64 F GLIBC_2.34 __semtimedop64 > F +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist > b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index > a3c80bc9ba..1323f731dd 100644 --- > a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ > b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2505,6 > +2505,7 @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 > __sem_timedwait64 F GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/sendmmsg.c > b/sysdeps/unix/sysv/linux/sendmmsg.c index 6093e9ed70..10aaff4d1f > 100644 --- a/sysdeps/unix/sysv/linux/sendmmsg.c > +++ b/sysdeps/unix/sysv/linux/sendmmsg.c > @@ -35,3 +35,6 @@ __sendmmsg (int fd, struct mmsghdr *vmessages, > unsigned int vlen, int flags) } > libc_hidden_def (__sendmmsg) > weak_alias (__sendmmsg, sendmmsg) > +#if __TIMESIZE !=3D 64 > +weak_alias (__sendmmsg, __sendmmsg64) > +#endif > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist > b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index > 6692749dac..af375af8d1 100644 --- > a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ > b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2360,6 +2360,7 @@ > GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist > b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index > 2207e3811c..e151761455 100644 --- > a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ > b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2357,6 +2357,7 @@ > GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 __sem_timedwait64 F > GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist > b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index > 16099127e5..ca186834b4 100644 --- > a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ > b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2500,6 > +2500,7 @@ GLIBC_2.34 __sem_clockwait64 F GLIBC_2.34 > __sem_timedwait64 F GLIBC_2.34 __semctl64 F > GLIBC_2.34 __semtimedop64 F > +GLIBC_2.34 __sendmmsg64 F > GLIBC_2.34 __setitimer64 F > GLIBC_2.34 __settimeofday64 F > GLIBC_2.34 __shmctl64 F > diff --git a/sysdeps/unix/sysv/linux/tst-scm_rights-time64.c > b/sysdeps/unix/sysv/linux/tst-scm_rights-time64.c new file mode 100644 > index 0000000000..302613cbfa > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/tst-scm_rights-time64.c > @@ -0,0 +1 @@ > +#include "tst-scm_rights.c" > diff --git a/sysdeps/unix/sysv/linux/tst-scm_rights.c > b/sysdeps/unix/sysv/linux/tst-scm_rights.c new file mode 100644 > index 0000000000..c85b873125 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/tst-scm_rights.c > @@ -0,0 +1,186 @@ > +/* Smoke test for SCM_RIGHTS. > + Copyright (C) 2021 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be > useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +/* This test passes a file descriptor from a subprocess to the parent > + process, using recvmsg/sendmsg or recvmmsg/sendmmsg. */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +/* String sent over the socket. */ > +static char DATA[] =3D "descriptor"; > + > +/* Path that is to be opened and sent over the socket. */ > +#define PATH "/etc" > + > +/* True if sendmmsg/recvmmsg is to be used. */ > +static bool use_multi_call; > + > +/* The pair of sockets used for coordination. The subprocess uses > + sockets[1]. */ > +static int sockets[2]; > + > +/* Subprocess side of one send/receive test. */ > +_Noreturn static void > +subprocess (void) > +{ > + /* The file descriptor to send. */ > + int fd =3D xopen (PATH, O_RDONLY, 0); > + > + struct iovec iov =3D { .iov_base =3D DATA, .iov_len =3D sizeof (DATA) = }; > + union > + { > + struct cmsghdr header; > + char bytes[CMSG_SPACE (sizeof (int))]; > + } cmsg_storage; > + struct mmsghdr mmhdr =3D > + { > + .msg_hdr =3D > + { > + .msg_iov =3D &iov, > + .msg_iovlen =3D 1, > + .msg_control =3D cmsg_storage.bytes, > + .msg_controllen =3D sizeof (cmsg_storage), > + }, > + }; > + > + /* Configure the file descriptor for sending. */ > + struct cmsghdr *cmsg =3D CMSG_FIRSTHDR (&mmhdr.msg_hdr); > + cmsg->cmsg_level =3D SOL_SOCKET; > + cmsg->cmsg_type =3D SCM_RIGHTS; > + cmsg->cmsg_len =3D CMSG_LEN (sizeof (int)); > + memcpy (CMSG_DATA (cmsg), &fd, sizeof (fd)); > + mmhdr.msg_hdr.msg_controllen =3D cmsg->cmsg_len; > + > + /* Perform the send operation. */ > + int ret; > + if (use_multi_call) > + { > + ret =3D sendmmsg (sockets[1], &mmhdr, 1, 0); > + if (ret >=3D 0) > + ret =3D mmhdr.msg_len; > + } > + else > + ret =3D sendmsg (sockets[1], &mmhdr.msg_hdr, 0); > + TEST_COMPARE (ret, sizeof (DATA)); > + > + xclose (fd); > + > + /* Stop the process from exiting. */ > + while (true) > + pause (); > +} > + > +/* Performs one send/receive test. */ > +static void > +one_test (void) > +{ > + TEST_COMPARE (socketpair (AF_UNIX, SOCK_STREAM, 0, sockets), 0); > + > + pid_t pid =3D xfork (); > + if (pid =3D=3D 0) > + subprocess (); > + > + char data_storage[sizeof (DATA) + 1]; > + struct iovec iov =3D > + { > + .iov_base =3D data_storage, > + .iov_len =3D sizeof (data_storage) > + }; > + union > + { > + struct cmsghdr header; > + char bytes[CMSG_SPACE (sizeof (int))]; > + } cmsg_storage; > + struct mmsghdr mmhdr =3D > + { > + .msg_hdr =3D > + { > + .msg_iov =3D &iov, > + .msg_iovlen =3D 1, > + .msg_control =3D cmsg_storage.bytes, > + .msg_controllen =3D sizeof (cmsg_storage), > + }, > + }; > + > + /* Set up the space for receiving the file descriptor. */ > + struct cmsghdr *cmsg =3D CMSG_FIRSTHDR (&mmhdr.msg_hdr); > + cmsg->cmsg_level =3D SOL_SOCKET; > + cmsg->cmsg_type =3D SCM_RIGHTS; > + cmsg->cmsg_len =3D CMSG_LEN (sizeof (int)); > + mmhdr.msg_hdr.msg_controllen =3D cmsg->cmsg_len; > + > + /* Perform the receive operation. */ > + int ret; > + if (use_multi_call) > + { > + ret =3D recvmmsg (sockets[0], &mmhdr, 1, 0, NULL); > + if (ret >=3D 0) > + ret =3D mmhdr.msg_len; > + } > + else > + ret =3D recvmsg (sockets[0], &mmhdr.msg_hdr, 0); > + TEST_COMPARE (ret, sizeof (DATA)); > + TEST_COMPARE_BLOB (data_storage, sizeof (DATA), DATA, sizeof > (DATA)); + > + /* Extract the file descriptor. */ > + TEST_VERIFY (CMSG_FIRSTHDR (&mmhdr.msg_hdr) !=3D NULL); > + TEST_COMPARE (CMSG_FIRSTHDR (&mmhdr.msg_hdr)->cmsg_len, > + CMSG_LEN (sizeof (int))); > + TEST_VERIFY (&cmsg_storage.header =3D=3D CMSG_FIRSTHDR > (&mmhdr.msg_hdr)); > + int fd; > + memcpy (&fd, CMSG_DATA (CMSG_FIRSTHDR (&mmhdr.msg_hdr)), sizeof > (fd)); + > + /* Verify the received file descriptor. */ > + TEST_VERIFY (fd > 2); > + struct stat64 st_fd; > + TEST_COMPARE (fstat64 (fd, &st_fd), 0); > + struct stat64 st_path; > + TEST_COMPARE (stat64 (PATH, &st_path), 0); > + TEST_COMPARE (st_fd.st_ino, st_path.st_ino); > + TEST_COMPARE (st_fd.st_dev, st_path.st_dev); > + xclose (fd); > + > + /* Terminate the subprocess. */ > + TEST_COMPARE (kill (pid, SIGUSR1), 0); > + int status; > + TEST_COMPARE (xwaitpid (pid, &status, 0), pid); > + TEST_VERIFY (WIFSIGNALED (status)); > + TEST_COMPARE (WTERMSIG (status), SIGUSR1); > + > + xclose (sockets[0]); > + xclose (sockets[1]); > +} > + > +static int > +do_test (void) > +{ > + one_test (); > + use_multi_call =3D true; > + one_test (); > + return 0; > +} > + > +#include Reviewed-by: Lukasz Majewski Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/g+26=ZgjQj+ZriV6vHrwLFJ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmD2j8wACgkQAR8vZIA0 zr1FvQgAja0X3u+fx7dn+Aw2EDCwAbFzXIYcRF5aGbZ3Kn4YqrNVWJmhHMVVOnwF NKurW4450oD84MhIiHNw2NConM/ae+Jg983ItcWu4Tz9CcmOMr/kbaacy2f5ujp3 er/zKlrTpsmrVM28gdflAjnAv6NZQw6pVf08ldEBS8tEwB6ZIzyCKuDeUpm1Prsl 6FrR5AJqa5AnVmwjzEeiorcl/E4obBei11FdiFdkTN5dqUCHL00M0gvPMoQXP869 YxmObR31tHCWpmc8K0wzJktuwMkoTUhl2wdZHg+E9szZINA1NQwAjtSnIHv+PP53 cZHMTXR6Syh0jO8vq+vw6z5EXCty5A== =hmyf -----END PGP SIGNATURE----- --Sig_/g+26=ZgjQj+ZriV6vHrwLFJ--