Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1224896
| From | Sean Fu <fxinrong@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. |
| Date | 2015-09-15 11:40 +0200 |
| Message-ID | <q8USt-QT-11@gated-at.bofh.it> (permalink) |
| References | (13 earlier) <q6u65-1i4-3@gated-at.bofh.it> <q7svg-5vh-21@gated-at.bofh.it> <q7zZN-7Wu-39@gated-at.bofh.it> <q8eJB-7J8-29@gated-at.bofh.it> <q8lL4-12U-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
According to POSIX standard, "The write() function shall attempt to
write nbyte bytes from the buffer pointed to by buf to the file
associated with the open file descriptor, fildes.".
So it is not the length of string(strlen).
On Mon, Sep 14, 2015 at 4:05 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Sun, 13 Sep 2015 20:39:31 +0800
> Sean Fu <fxinrong@gmail.com> wrote:
>
>
>> > Accepting a '\0' is not at all reasonable for a text interface. The
>> > application that does it is buggy.
>> It is hard to comprehend that the current kernel can accept two bytes
>> "1 ", "1\t", "1\n" except "1\0".
>
> Um, it does not seem hard to comprehend at all. As this is a string,
> and it acts the same as a printf() or strlen.
>
> strlen("1 ") == 2
> strlen("1\t") == 2
> strlen("1\n") == 2
> strlen("1\0") == 1
>
> Big difference to me.
>
> -- Steve
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-09-08 05:20 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-09-08 17:20 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. ebiederm@xmission.com (Eric W. Biederman) - 2015-09-08 18:30 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-09-08 18:40 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-09-11 11:10 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-09-11 15:50 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. ebiederm@xmission.com (Eric W. Biederman) - 2015-09-11 19:10 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-09-13 14:40 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. ebiederm@xmission.com (Eric W. Biederman) - 2015-09-13 19:00 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-09-15 11:40 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. "Eric W. Biederman" <ebiederm@xmission.com> - 2015-09-15 16:20 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-09-13 22:10 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Sean Fu <fxinrong@gmail.com> - 2015-09-15 11:40 +0200
Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. Steven Rostedt <rostedt@goodmis.org> - 2015-09-15 16:00 +0200
csiph-web