delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2002/06/12/11:48:19

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Date: Wed, 12 Jun 2002 19:45:20 +0400
From: egor duda <deo AT logos-m DOT ru>
Reply-To: egor duda <cygwin-developers AT cygwin DOT com>
Organization: deo
X-Priority: 3 (Normal)
Message-ID: <1149904301.20020612194520@logos-m.ru>
To: "Conrad Scott" <Conrad DOT Scott AT dsl DOT pipex DOT com>
CC: cygwin-developers AT cygwin DOT com
Subject: Re: DuplicateHandle() question
In-Reply-To: <091e01c2120f$25e50290$6132bc3e@BABEL>
References: <091e01c2120f$25e50290$6132bc3e AT BABEL>
MIME-Version: 1.0

Hi!

Wednesday, 12 June, 2002 Conrad Scott Conrad DOT Scott AT dsl DOT pipex DOT com wrote:

CS> [I hope this is sufficiently on-topic for this list.]

CS> I'm looking at the cygserver shm implementation and I've got a Win32 issue
CS> that I wondered if anyone out there might be able to help me with.

CS> The problem is that the server uses DuplicateHandle() to create a handle in
CS> the client process. Then if the server later decides to abort the operation,

It'd be late to decide. Being a server doesn't make it so important to
decide for other process what to do with its handles.

CS> how can it close that child handle? Or can't it? If it can't, the server
CS> will have to arrange for the client to close it for itself, which makes the
CS> error handling all the more complex (i.e. send back the offending handle
CS> along with the error response).

CS> Any thoughts? or am I misunderstanding some deep fact about Win32 handles?

Win32 handles are pretty similar to unix descriptors. if some process
duplicates an fd and pass it, say, to child, it has no control of what
child will do with his fds.

I don't quite understand why server would want client to discard some
handle. Can you describe step-by-step scenario when it's needed? Do
you have shmctl(..., IPC_RMID, ...) in mind?

Egor.            mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019