Message ID | 20201123203445.5491-1-alx.manpages@gmail.com |
---|---|
State | Not applicable |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD01D3833014; Mon, 23 Nov 2020 20:35:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD01D3833014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1606163716; bh=bC9Xwb1/XxVmdsfGziSMeZlvPwZj+jolzd/dm7uTUlc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=AZA4/Ua5E4FrPZevcEbhKfyU4jRgpnqGnO3hFv1iEXnnkGD6d2gPApvlnJLURkUm8 dLl2NE6MJ8Cg4GezxJtFZpDWb1USstqvhazYJiPr1oMuuZSH11CDWwBvAMTRG3NDv6 Na7/ohxO1KX9EvLOV8RussAJXzOeZHxjbRvAZ0dk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by sourceware.org (Postfix) with ESMTPS id BDC053854803 for <libc-alpha@sourceware.org>; Mon, 23 Nov 2020 20:35:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BDC053854803 Received: by mail-wm1-x342.google.com with SMTP id x22so567996wmc.5 for <libc-alpha@sourceware.org>; Mon, 23 Nov 2020 12:35:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bC9Xwb1/XxVmdsfGziSMeZlvPwZj+jolzd/dm7uTUlc=; b=cT12qa50IWTfnz3AR7oMdF+x0Py5FTI+e5uWethuVFxps4UZFl0e6V6WOA/lPU9L7l WfHLouYLZ+Db6G6tg1JFDvYzXnAvgXVYsycngIOgWw6+1epku3C+TUhlZcHzlxjdQpGF PYITFXu92MYSDF/abefPCpFV/PmXsTUWJAg7oPs3cY0YEMaQWzoOJUjHZOHoHy7rGtzt R0R66d+etB13k/yvuohOAdL3JViF5ygEwJr51SzZ4xrmN5Ug+Q227INX6u+tC+fcANyC UusUh1zLvFyfcCwfm3BCK6vceUosegYCoqqCgp3zaUGX/6NmJa1XtOGivY38LjR2v+m/ cvBA== X-Gm-Message-State: AOAM531gklnw0dFjspCuDJ7LMtFrMeIU9I4D8phd3f2fY50p+Wyki8Vt F/oMVsMRL7GqGrklY1xFrro= X-Google-Smtp-Source: ABdhPJwooiUEBegF5xcGkpWf8RQbVJB670XGFbeN+pGN/iWhUo2GDcSHb1Rwh/eh0QI/brhmWbUKTw== X-Received: by 2002:a1c:6a0d:: with SMTP id f13mr675303wmc.172.1606163712822; Mon, 23 Nov 2020 12:35:12 -0800 (PST) Received: from localhost.localdomain ([170.253.51.130]) by smtp.gmail.com with ESMTPSA id j8sm21282828wrx.11.2020.11.23.12.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 12:35:12 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH] restart_syscall.2: SYNOPSIS: Fix restart_syscall() return type Date: Mon, 23 Nov 2020 21:34:46 +0100 Message-Id: <20201123203445.5491-1-alx.manpages@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Alejandro Colomar <alx.manpages@gmail.com> Cc: Alejandro Colomar <alx.manpages@gmail.com>, linux-man@vger.kernel.org, libc-alpha@sourceware.org, linux-kernel@vger.kernel.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
restart_syscall.2: SYNOPSIS: Fix restart_syscall() return type
|
|
Commit Message
Alejandro Colomar
Nov. 23, 2020, 8:34 p.m. UTC
The Linux kernel uses 'long' instead of 'int' for the return type.
As glibc provides no wrapper, use the same types the kernel uses.
$ grep -rn 'SYSCALL_DEFINE.*(restart_syscall'
kernel/signal.c:2891:SYSCALL_DEFINE0(restart_syscall)
$ sed -n 2891,2895p kernel/signal.c
SYSCALL_DEFINE0(restart_syscall)
{
struct restart_block *restart = ¤t->restart_block;
return restart->fn(restart);
}
$ grep -rn 'struct restart_block {'
include/linux/restart_block.h:25:struct restart_block {
$ sed -n 25,56p include/linux/restart_block.h
struct restart_block {
long (*fn)(struct restart_block *);
union {
/* For futex_wait and futex_wait_requeue_pi */
struct {
u32 __user *uaddr;
u32 val;
u32 flags;
u32 bitset;
u64 time;
u32 __user *uaddr2;
} futex;
/* For nanosleep */
struct {
clockid_t clockid;
enum timespec_type type;
union {
struct __kernel_timespec __user *rmtp;
struct old_timespec32 __user *compat_rmtp;
};
u64 expires;
} nanosleep;
/* For poll */
struct {
struct pollfd __user *ufds;
int nfds;
int has_timeout;
unsigned long tv_sec;
unsigned long tv_nsec;
} poll;
};
};
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man2/restart_syscall.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Alex, On 11/23/20 9:34 PM, Alejandro Colomar wrote: > The Linux kernel uses 'long' instead of 'int' for the return type. > As glibc provides no wrapper, use the same types the kernel uses. > > $ grep -rn 'SYSCALL_DEFINE.*(restart_syscall' > kernel/signal.c:2891:SYSCALL_DEFINE0(restart_syscall) > > $ sed -n 2891,2895p kernel/signal.c > SYSCALL_DEFINE0(restart_syscall) > { > struct restart_block *restart = ¤t->restart_block; > return restart->fn(restart); > } > > $ grep -rn 'struct restart_block {' > include/linux/restart_block.h:25:struct restart_block { > > $ sed -n 25,56p include/linux/restart_block.h > struct restart_block { > long (*fn)(struct restart_block *); > union { > /* For futex_wait and futex_wait_requeue_pi */ > struct { > u32 __user *uaddr; > u32 val; > u32 flags; > u32 bitset; > u64 time; > u32 __user *uaddr2; > } futex; > /* For nanosleep */ > struct { > clockid_t clockid; > enum timespec_type type; > union { > struct __kernel_timespec __user *rmtp; > struct old_timespec32 __user *compat_rmtp; > }; > u64 expires; > } nanosleep; > /* For poll */ > struct { > struct pollfd __user *ufds; > int nfds; > int has_timeout; > unsigned long tv_sec; > unsigned long tv_nsec; > } poll; > }; > }; > > Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Thanks! Patch applied. Cheers, Michael > --- > man2/restart_syscall.2 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/man2/restart_syscall.2 b/man2/restart_syscall.2 > index e7d96bd4d..21cc2df1d 100644 > --- a/man2/restart_syscall.2 > +++ b/man2/restart_syscall.2 > @@ -34,7 +34,7 @@ > .SH NAME > restart_syscall \- restart a system call after interruption by a stop signal > .SH SYNOPSIS > -.B int restart_syscall(void); > +.B long restart_syscall(void); > .PP > .IR Note : > There is no glibc wrapper for this system call; see NOTES. >
diff --git a/man2/restart_syscall.2 b/man2/restart_syscall.2 index e7d96bd4d..21cc2df1d 100644 --- a/man2/restart_syscall.2 +++ b/man2/restart_syscall.2 @@ -34,7 +34,7 @@ .SH NAME restart_syscall \- restart a system call after interruption by a stop signal .SH SYNOPSIS -.B int restart_syscall(void); +.B long restart_syscall(void); .PP .IR Note : There is no glibc wrapper for this system call; see NOTES.