taskThe GNU Hurd - Tasks: task #1021, new interface io_close

 
 

task #1021: new interface io_close

Submitter:  Marcus Brinkmann <marcus>
Submitted:  -
   
 
Category:  The GNU Hurd Should Start On:  Sun 26 May 2002 10:00:00 PM UTC
Should be Finished on:  Sun 26 May 2002 10:00:00 PM UTC Priority:  * 7 - High
Status:  None Privacy:  Public
Assigned to:  thomas Percent Complete:  10%
Open/Closed:  Open Planned Release:  None
Effort:  0.00
Wiki-like text discussion box: 


* Mandatory Fields

Add a New Comment Rich Markup
   

-, original submission:  

io_close is necessary to synchronize the deallocation of a port with the server.  It is optional, but only its use will guarantee the user's proper synchronization in the following cases:
1) closing read end of a pipe against writing to it.
2) SO_LINGER on a socket
3) removing record locks
4) SysV SHM

io_close has to move the send right to the server, which can then deallocate it and do synchronization.

A complication is the interruptability.  The question was raised if the RPC needs to be restartable after being interrupted. In that case the server would need to recreate the send right and move it back to the client.  This would require special RPC stubs in GLibC and on the server side to make this work. 

However, a thorough reading of the PSIX standard says that the status of the file descriptor after an interrupted close is unspecified.  This means that we don't need to keep the fd in its original state or fully closed when the io_close operation is interrupted.  Instead, we can just coninue with  the close asynchronously on the server side and return to the user, invalidating and deallocating the fd on the user side.

This means that no special server RPC stub is necessary.  On the user side, a special stub is still needed to convert error codes (EINTR->EBADFD or such) and to not attempt to restart an interrupted io_close operation.

Marcus Brinkmann <marcus>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2002-11-18 marcus Percent CompleteNone None

Back to the top

Powered by Savane 3.14-e222.
Corresponding source code