From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id 7F1601EF6B4; Fri, 19 Jul 2013 11:02:03 -0400 (EDT) Received: from mail0200.smtp25.com (mail0200.smtp25.com [174.37.170.200]) by befuddled.reisers.ca (Postfix) with ESMTPS id BB2F61EF56E for ; Fri, 19 Jul 2013 11:02:02 -0400 (EDT) Received: from ccs.covici.com (s-out-001.smtp25.com [67.228.91.90]) by s-out-001.smtp25.com (8.14.2/8.14.2) with ESMTP id r6JF1xO9021749 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 19 Jul 2013 11:02:00 -0400 Received: from ccs.covici.com (localhost [127.0.0.1]) by ccs.covici.com (8.14.7/8.14.5) with ESMTP id r6JF1xJe010001 for ; Fri, 19 Jul 2013 11:01:59 -0400 To: "Speakup is a screen review system for Linux." Subject: Re: ot memory allocation question In-reply-to: <87fvvawwrj.fsf@mushroom.PK5001Z> References: <41356f9b-e7c3-4522-b960-142abea1cedd@default> <87fvvawwrj.fsf@mushroom.PK5001Z> Comments: In-reply-to Chris Brannon message dated "Fri, 19 Jul 2013 05:37:52 -0700." X-Mailer: MH-E 8.2; nmh 1.3; GNU Emacs 23.4.1 Date: Fri, 19 Jul 2013 11:01:59 -0400 Message-ID: <9998.1374246119@ccs.covici.com> From: covici@ccs.covici.com X-SpamH-OriginatingIP: 70.109.53.110 X-SpamH-Filter: s-out-001.smtp25.com-r6JF1xO9021749 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.2 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: "Speakup is a screen review system for Linux." List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2013 15:02:03 -0000 So could we use this inspeakup to write and read from a serial device -- thus circumventing most of our serial problems? Chris Brannon wrote: > Don Raikes writes: > > My solution: > > > > Allocate a new larger buffer inside of the userspace and copy_to_user > > into the new buffer and then when I pass control to the "real" > > sys_write function point it to the new buffer. > > But the problem is how do I allocate this new buffer? > > There's no easy way to do this. You can't just pass your kernel > buffer to the system call you are intercepting, since the intercepted > call expects a user-space buffer. > Have a look at this link for some inspiration: > http://web.cs.wpi.edu/~cs4513/b05/proj1note2.txt > > Also be careful about the return value of the real sys_write system > call. If you're passing it a buffer larger than the n bytes passed in > from userspace, its return value can be greater than n. Don't just use > it unmodified as the return value for your function. > > -- Chris > _______________________________________________ > Speakup mailing list > Speakup@linux-speakup.org > http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup -- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com