From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3284 Path: news.gmane.org!not-for-mail From: Jens Newsgroups: gmane.linux.lib.musl.general Subject: procfs stdio writev problem Date: Sun, 5 May 2013 11:16:55 +0200 (CEST) Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1367745409 15726 80.91.229.3 (5 May 2013 09:16:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 May 2013 09:16:49 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3288-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 05 11:16:50 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UYv3o-0005Bp-7l for gllmg-musl@plane.gmane.org; Sun, 05 May 2013 11:16:48 +0200 Original-Received: (qmail 26578 invoked by uid 550); 5 May 2013 09:16:46 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 26570 invoked from network); 5 May 2013 09:16:46 -0000 User-Agent: Alpine 2.10 (LNX 1266 2009-07-14) Xref: news.gmane.org gmane.linux.lib.musl.general:3284 Archived-At: Hello! I've noticed a problem when using bash linked with musl. laas:~# echo 60 > /proc/sys/kernel/panic -su: echo: write error: Invalid argument laas:~# cat t.sh #!/bin/bash echo 60 > /proc/sys/kernel/panic laas:~# strace -f t.sh ... writev(1, [{"60", 2}, {"\n", 1}], 2) = 2 writev(1, [{"", 0}, {"\n", 1}], 2) = -1 EINVAL (Invalid argument) I'm guessing that musl uses writev in its stdio implementation. And I think the error is due to a simplistic implementation in procfs, that parses each write on its own, and that the writev is split into several writes. This is with linux kernel 3.6.0 btw. I have no idea if something can and should be done about this, but likely somebody else will run into the same problem. Regards, Jens