From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758344AbcDHSKv (ORCPT ); Fri, 8 Apr 2016 14:10:51 -0400 Received: from mout.gmx.net ([212.227.15.15]:64752 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbcDHSKt (ORCPT ); Fri, 8 Apr 2016 14:10:49 -0400 Subject: Re: [PATCH] leftpad.2: Document new syscall To: Richard Weinberger , linux-kernel@vger.kernel.org References: <1459463613-32473-1-git-send-email-richard@nod.at> <1459463613-32473-3-git-send-email-richard@nod.at> Cc: linux-api@vger.kernel.org, Daniel Walter , "Michael Kerrisk (man-pages)" , Greg Kroah-Hartman From: Heinrich Schuchardt Message-ID: <5707F419.6060300@gmx.de> Date: Fri, 8 Apr 2016 20:10:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0 MIME-Version: 1.0 In-Reply-To: <1459463613-32473-3-git-send-email-richard@nod.at> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:3eznkjLqrWEukI78TFKnw/nA4x+Pg/oEAaNkFlHcV5TxizydUiG 5WJ69uOnXmb9pF2MiSXQ75o+cpTzmikgtQKSJakUPEKbjfD+hbAATdHFOV4UswRCCK0CV0R 1CV7u8D5/6ZnCTGK2TLtk3ceglCUMCxVCFpnyiIYM6xWVjLQ7k/hY697dOW6Li7mazo1JMe VM4YCoLSS8Pp7e60KP4tg== X-UI-Out-Filterresults: notjunk:1;V01:K0:ZDr54vcokTY=:VrSO/4nPxk9XkCRe8iARZD 3qLeetsUSopt384gFEGSVyJ55Mvgq2EbI8SptmZJdXTzq4IXKstirXzcOy3zE0l1+FkZ/tMOr giE88s0vZbZ1wRUzJAVdebhzJ6O3lQRqMJKYiiJhDGyoTEKJiuPUVpv0ubUFe4pVmjOA1gQu2 aTcMKamFJyqM5MA3TvT5LnZ0QkxSCWwJcBZZNWOdJvWXERDGb33NGiNwTE/WrtbYUHojtiSNZ j5LMV5MHCFSj+N4KJpJQkb+7DXEvVGfrpswjk7DyYTkdJIH5LupewurU/KlX4L7tS4GDkUXsY QK8t2HsuMog9eQHNnEDkPaOH/S7lTh0fZ+I53mexIKrJVkQwF4aN2qQtyP+RF/kWXlUfDx6wV J9MmGiEpekG91w9NALS5tY5iKBAJQwKyYXH4kwygvonb710xG3AajTs/KTCrSeNITt895j2e7 2SLZI3R26t4DsCK/xh2w8yzgz3MZfFtFEogY5qHIKGVIazxK/uuHUyipc41ilGRz6oKv6eBr+ a415/LTzjUSyjOSQsaTXaKjRh7e7w6RxBZytBuEzjdZVZ0PQ091Nmt6+Cw0yF8JsPNL+HC2qo wc+RLxW4jVSj8+YprV6ZI/NQXHyX3GXv5d/dAfeqjJV7vNP5VSq1DtfteSGWUvujEJQDNLJng 776lduS0tiRjtCdfAwsnVjXqxMW5B95NVdDw35GtP2X0szIsVn2am9e4ATfoH/ZHqFivIH1uv qHOKOrMhDzVsEujUUkEQtthjsd79+1Od/vDGuUiZzqHppTgGVuOdOd17TeZ5hBbrP+1GTqr+H AeL4P7Q Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/01/2016 12:33 AM, Richard Weinberger wrote: > From: Daniel Walter > > Signed-off-by: Daniel Walter > Signed-off-by: Richard Weinberger > --- > man2/leftpad.2 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > create mode 100644 man2/leftpad.2 > > diff --git a/man2/leftpad.2 b/man2/leftpad.2 > new file mode 100644 > index 0000000..ff5f401 > --- /dev/null > +++ b/man2/leftpad.2 > @@ -0,0 +1,55 @@ > +.\" Copyright (c) 2016 sigma-star gmbh > +.\" (office@sigma-star.at) > +.\" > +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) > +.\" This is free documentation; you can redistribute it and/or > +.\" modify it under the terms of the GNU General Public License as > +.\" published by the Free Software Foundation; either version 2 of > +.\" the License, or (at your option) any later version. > +.\" > +.\" The GNU General Public License's references to "object code" > +.\" and "executables" are to be interpreted as the output of any > +.\" document formatting or typesetting system, including > +.\" intermediate and printed output. > +.\" > +.\" This manual 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 General Public License for more details. > +.\" > +.\" You should have received a copy of the GNU General Public > +.\" License along with this manual; if not, see > +.\" . > +.\" %%%LICENSE_END > +.\" > +.TH LEFTPAD 2 2016-04-01 "Linux" "Linux Programmer's Manual" > +.SH NAME > +leftpad > +.SH SYNOPSIS > +.nf > +.B #include > + > +.BI "int leftpad(char *src, char pad, char *dst, size_t dst_len); > +.fi > +.SH DESCRIPTION > +This function provides left padding for strings. > +.LP > +The string in > +.I src > +will be left padded with the chosen padding character > +.I pad > +and stored in > +.I dst > + . > +.SH RETURN VALUE > +On success, returns the number of padding characters added. > +.SH ERRORS > +.TP > +.B EINVAL > +The size of the destination buffer > +.I dst > +is shorter than the source string > +.I src > + . Or the destination string is longer than 4096 bytes. Why should the call be limited to an arbitrary number of 4096 bytes? There is no such limit in malloc so why should we need one here? NAK Best regards Heinrich Schuchardt > +.SH SEE ALSO > +.BR snprintf (3) > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heinrich Schuchardt Subject: Re: [PATCH] leftpad.2: Document new syscall Date: Fri, 8 Apr 2016 20:10:33 +0200 Message-ID: <5707F419.6060300@gmx.de> References: <1459463613-32473-1-git-send-email-richard@nod.at> <1459463613-32473-3-git-send-email-richard@nod.at> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1459463613-32473-3-git-send-email-richard-/L3Ra7n9ekc@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Richard Weinberger , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Daniel Walter , "Michael Kerrisk (man-pages)" , Greg Kroah-Hartman List-Id: linux-api@vger.kernel.org On 04/01/2016 12:33 AM, Richard Weinberger wrote: > From: Daniel Walter > > Signed-off-by: Daniel Walter > Signed-off-by: Richard Weinberger > --- > man2/leftpad.2 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > create mode 100644 man2/leftpad.2 > > diff --git a/man2/leftpad.2 b/man2/leftpad.2 > new file mode 100644 > index 0000000..ff5f401 > --- /dev/null > +++ b/man2/leftpad.2 > @@ -0,0 +1,55 @@ > +.\" Copyright (c) 2016 sigma-star gmbh > +.\" (office-S6VGOU4v5edDinCvNWH78Q@public.gmane.org) > +.\" > +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) > +.\" This is free documentation; you can redistribute it and/or > +.\" modify it under the terms of the GNU General Public License as > +.\" published by the Free Software Foundation; either version 2 of > +.\" the License, or (at your option) any later version. > +.\" > +.\" The GNU General Public License's references to "object code" > +.\" and "executables" are to be interpreted as the output of any > +.\" document formatting or typesetting system, including > +.\" intermediate and printed output. > +.\" > +.\" This manual 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 General Public License for more details. > +.\" > +.\" You should have received a copy of the GNU General Public > +.\" License along with this manual; if not, see > +.\" . > +.\" %%%LICENSE_END > +.\" > +.TH LEFTPAD 2 2016-04-01 "Linux" "Linux Programmer's Manual" > +.SH NAME > +leftpad > +.SH SYNOPSIS > +.nf > +.B #include > + > +.BI "int leftpad(char *src, char pad, char *dst, size_t dst_len); > +.fi > +.SH DESCRIPTION > +This function provides left padding for strings. > +.LP > +The string in > +.I src > +will be left padded with the chosen padding character > +.I pad > +and stored in > +.I dst > + . > +.SH RETURN VALUE > +On success, returns the number of padding characters added. > +.SH ERRORS > +.TP > +.B EINVAL > +The size of the destination buffer > +.I dst > +is shorter than the source string > +.I src > + . Or the destination string is longer than 4096 bytes. Why should the call be limited to an arbitrary number of 4096 bytes? There is no such limit in malloc so why should we need one here? NAK Best regards Heinrich Schuchardt > +.SH SEE ALSO > +.BR snprintf (3) >