From: Heinrich Schuchardt <xypron.glpk@gmx.de> To: Richard Weinberger <richard@nod.at>, linux-kernel@vger.kernel.org Cc: linux-api@vger.kernel.org, Daniel Walter <dwalter@sigma-star.at>, "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Subject: Re: [PATCH] leftpad.2: Document new syscall Date: Fri, 8 Apr 2016 20:10:33 +0200 [thread overview] Message-ID: <5707F419.6060300@gmx.de> (raw) In-Reply-To: <1459463613-32473-3-git-send-email-richard@nod.at> On 04/01/2016 12:33 AM, Richard Weinberger wrote: > From: Daniel Walter <dwalter@sigma-star.at> > > Signed-off-by: Daniel Walter <dwalter@sigma-star.at> > Signed-off-by: Richard Weinberger <richard@nod.at> > --- > 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 > +.\" <http://www.gnu.org/licenses/>. > +.\" %%%LICENSE_END > +.\" > +.TH LEFTPAD 2 2016-04-01 "Linux" "Linux Programmer's Manual" > +.SH NAME > +leftpad > +.SH SYNOPSIS > +.nf > +.B #include <sys/types.h> > + > +.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) >
WARNING: multiple messages have this Message-ID (diff)
From: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org> To: Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org>, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Daniel Walter <dwalter-S6VGOU4v5edDinCvNWH78Q@public.gmane.org>, "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> Subject: Re: [PATCH] leftpad.2: Document new syscall Date: Fri, 8 Apr 2016 20:10:33 +0200 [thread overview] Message-ID: <5707F419.6060300@gmx.de> (raw) In-Reply-To: <1459463613-32473-3-git-send-email-richard-/L3Ra7n9ekc@public.gmane.org> On 04/01/2016 12:33 AM, Richard Weinberger wrote: > From: Daniel Walter <dwalter-S6VGOU4v5edDinCvNWH78Q@public.gmane.org> > > Signed-off-by: Daniel Walter <dwalter-S6VGOU4v5edDinCvNWH78Q@public.gmane.org> > Signed-off-by: Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org> > --- > 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 > +.\" <http://www.gnu.org/licenses/>. > +.\" %%%LICENSE_END > +.\" > +.TH LEFTPAD 2 2016-04-01 "Linux" "Linux Programmer's Manual" > +.SH NAME > +leftpad > +.SH SYNOPSIS > +.nf > +.B #include <sys/types.h> > + > +.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) >
next prev parent reply other threads:[~2016-04-08 18:10 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-03-31 22:33 New syscall: leftpad() Richard Weinberger 2016-03-31 22:33 ` Richard Weinberger 2016-03-31 22:33 ` [PATCH] Implement leftpad syscall Richard Weinberger 2016-03-31 22:46 ` Michael Kerrisk (man-pages) 2016-03-31 22:46 ` Michael Kerrisk (man-pages) 2016-03-31 23:09 ` Greg KH 2016-03-31 23:09 ` Greg KH 2016-04-01 1:33 ` Frederic Weisbecker 2016-04-01 3:22 ` kbuild test robot 2016-04-01 3:22 ` kbuild test robot 2016-04-01 6:56 ` Richard Cochran 2016-04-01 6:56 ` Richard Cochran 2016-04-01 7:14 ` Scotty Bauer 2016-03-31 22:33 ` [PATCH] leftpad.2: Document new syscall Richard Weinberger 2016-04-08 18:10 ` Heinrich Schuchardt [this message] 2016-04-08 18:10 ` Heinrich Schuchardt 2016-04-09 14:12 ` Richard Weinberger 2016-03-31 23:36 ` New syscall: leftpad() Randy Dunlap 2016-03-31 23:36 ` Randy Dunlap 2016-04-01 8:06 ` Richard Weinberger 2016-04-01 8:06 ` Richard Weinberger
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=5707F419.6060300@gmx.de \ --to=xypron.glpk@gmx.de \ --cc=dwalter@sigma-star.at \ --cc=gregkh@linuxfoundation.org \ --cc=linux-api@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mtk.manpages@gmail.com \ --cc=richard@nod.at \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.