From owner-freebsd-current@FreeBSD.ORG Sat Nov 29 13:12:52 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 885C116A4CE; Sat, 29 Nov 2003 13:12:52 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id B66E843FBD; Sat, 29 Nov 2003 13:12:51 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id A9DDF2ED45A; Sat, 29 Nov 2003 13:12:51 -0800 (PST) Date: Sat, 29 Nov 2003 13:12:51 -0800 From: Alfred Perlstein To: Daniel Eischen Message-ID: <20031129211251.GV35957@elvis.mu.org> References: <20031123023649.GG35957@elvis.mu.org> <20031129202138.GU35957@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031129202138.GU35957@elvis.mu.org> User-Agent: Mutt/1.4.1i cc: re@freebsd.org cc: current@freebsd.org Subject: Re: [PATCH] please review. file descriptor passing for libc_r. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2003 21:12:52 -0000 * Alfred Perlstein [031129 12:21] wrote: > > Descriptor's passed can't be closed because the uthread kernel does this: The weird part is that i'm doing a sendfile(2) using the descriptors and it appears that sendfile does the FD_LOCK thing on the descriptors so... ? > > int > _close(int fd) > { > int flags; > int ret; > struct stat sb; > struct fd_table_entry *entry; > > if ((fd < 0) || (fd >= _thread_dtablesize) || > (fd == _thread_kern_pipe[0]) || (fd == _thread_kern_pipe[1]) || > (_thread_fd_table[fd] == NULL)) { > /* > * Don't allow silly programs to close the kernel pipe > * and non-active descriptors. > */ > errno = EBADF; > ret = -1; > } > ... > > So basically, if the entry is not initialized we can't close descriptors. > > What do you suggest we do? > > -- > - Alfred Perlstein > - Research Engineering Development Inc. > - email: bright@mu.org cell: 408-480-4684 -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684