lkml.org 
[lkml]   [1999]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch-2.3.29] bugfix for pipe(2) system call.
On Thu, 25 Nov 1999, David Howells wrote:
> I'd say there's a lot easier way of checking your pipe problem: pre-initialise
> both elements of the array to -1 or something. It's only two int's, so the
> performance penalty will be minimal.

what do you mean? You mean like this:

asmlinkage int sys_pipe(unsigned long * fildes)
{
int fd[2] = {-1, -1};
int error;

lock_kernel();
error = do_pipe(fd);
unlock_kernel();
if (!error) {
if (copy_to_user(fildes, fd, 2*sizeof(int)))
error = -EFAULT;
}
return error;
}

so what? if the user does pipe(0) she will still leak two descriptors (and
files and inodes and any other resources), won't she? I just verified this
to make sure I am not blindly missing something obvious...

So, please clarify what you mean and how it will solve the resource leak
caused by pipe(NULL) call?

Regards,
Tigran.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.041 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site