Index: trunk/src/libs/xpcom18a4/nsprpub/pr/include/prio.h
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/include/prio.h	(revision 102051)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/include/prio.h	(revision 102063)
@@ -441,146 +441,4 @@
 /*
  **************************************************************************
- * FUNCTION: PR_GetSpecialFD
- * DESCRIPTION: Get the file descriptor that represents the standard input,
- *              output, or error stream.
- * INPUTS:
- *     PRSpecialFD id
- *         A value indicating the type of stream desired:
- *             PR_StandardInput: standard input
- *             PR_StandardOuput: standard output
- *             PR_StandardError: standard error
- * OUTPUTS: none
- * RETURNS: PRFileDesc *
- *     If the argument is valid, PR_GetSpecialFD returns a file descriptor
- *     that represents the corresponding standard I/O stream.  Otherwise,
- *     PR_GetSpecialFD returns NULL and sets error PR_INVALID_ARGUMENT_ERROR.
- **************************************************************************
- */
-
-typedef enum PRSpecialFD
-{
-    PR_StandardInput,          /* standard input */
-    PR_StandardOutput,         /* standard output */
-    PR_StandardError           /* standard error */
-} PRSpecialFD;
-
-NSPR_API(PRFileDesc*) PR_GetSpecialFD(PRSpecialFD id);
-
-#define PR_STDIN	PR_GetSpecialFD(PR_StandardInput)
-#define PR_STDOUT	PR_GetSpecialFD(PR_StandardOutput)
-#define PR_STDERR	PR_GetSpecialFD(PR_StandardError)
-
-/*
- **************************************************************************
- * Layering file descriptors
- *
- * File descriptors may be layered. Each layer has it's own identity.
- * Identities are allocated by the runtime and are to be associated
- * (by the layer implementor) with all layers that are of that type.
- * It is then possible to scan the chain of layers and find a layer
- * that one recongizes and therefore predict that it will implement
- * a desired protocol.
- *
- * There are three well-known identities:
- *      PR_INVALID_IO_LAYER => an invalid layer identity, for error return
- *      PR_TOP_IO_LAYER     => the identity of the top of the stack
- *      PR_NSPR_IO_LAYER    => the identity used by NSPR proper
- * PR_TOP_IO_LAYER may be used as a shorthand for identifying the topmost
- * layer of an existing stack. Ie., the following two constructs are
- * equivalent.
- *
- *      rv = PR_PushIOLayer(stack, PR_TOP_IO_LAYER, my_layer);
- *      rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), my_layer)
- *
- * A string may be associated with the creation of the identity. It
- * will be copied by the runtime. If queried the runtime will return
- * a reference to that copied string (not yet another copy). There
- * is no facility for deleting an identity.
- **************************************************************************
- */
-
-#define PR_IO_LAYER_HEAD (PRDescIdentity)-3
-#define PR_INVALID_IO_LAYER (PRDescIdentity)-1
-#define PR_TOP_IO_LAYER (PRDescIdentity)-2
-#define PR_NSPR_IO_LAYER (PRDescIdentity)0
-
-NSPR_API(PRDescIdentity) PR_GetUniqueIdentity(const char *layer_name);
-NSPR_API(const char*) PR_GetNameForIdentity(PRDescIdentity ident);
-NSPR_API(PRDescIdentity) PR_GetLayersIdentity(PRFileDesc* fd);
-NSPR_API(PRFileDesc*) PR_GetIdentitiesLayer(PRFileDesc* fd_stack, PRDescIdentity id);
-
-/*
- **************************************************************************
- * PR_GetDefaultIOMethods: Accessing the default methods table.
- * You may get a pointer to the default methods table by calling this function.
- * You may then select any elements from that table with which to build your
- * layer's methods table. You may NOT modify the table directly.
- **************************************************************************
- */
-NSPR_API(const PRIOMethods *) PR_GetDefaultIOMethods(void);
-
-/*
- **************************************************************************
- * Creating a layer
- *
- * A new layer may be allocated by calling PR_CreateIOLayerStub(). The
- * file descriptor returned will contain the pointer to the methods table
- * provided. The runtime will not modify the table nor test its correctness.
- **************************************************************************
- */
-NSPR_API(PRFileDesc*) PR_CreateIOLayerStub(
-    PRDescIdentity ident, const PRIOMethods *methods);
-
-/*
- **************************************************************************
- * Creating a layer
- *
- * A new stack may be created by calling PR_CreateIOLayer(). The
- * file descriptor returned will point to the top of the stack, which has
- * the layer 'fd' as the topmost layer.
- * 
- * NOTE: This function creates a new style stack, which has a fixed, dummy
- * header. The old style stack, created by a call to PR_PushIOLayer,
- * results in modifying contents of the top layer of the stack, when
- * pushing and popping layers of the stack.
- **************************************************************************
- */
-NSPR_API(PRFileDesc*) PR_CreateIOLayer(PRFileDesc* fd);
-
-/*
- **************************************************************************
- * Pushing a layer
- *
- * A file descriptor (perhaps allocated using PR_CreateIOLayerStub()) may
- * be pushed into an existing stack of file descriptors at any point the
- * caller deems appropriate. The new layer will be inserted into the stack
- * just above the layer with the indicated identity.
- *
- * Note: Even if the identity parameter indicates the top-most layer of
- * the stack, the value of the file descriptor describing the original
- * stack will not change.
- **************************************************************************
- */
-NSPR_API(PRStatus) PR_PushIOLayer(
-    PRFileDesc *fd_stack, PRDescIdentity id, PRFileDesc *layer);
-
-/*
- **************************************************************************
- * Popping a layer
- *
- * A layer may be popped from a stack by indicating the identity of the
- * layer to be removed. If found, a pointer to the removed object will
- * be returned to the caller. The object then becomes the responsibility
- * of the caller.
- *
- * Note: Even if the identity indicates the top layer of the stack, the
- * reference returned will not be the file descriptor for the stack and
- * that file descriptor will remain valid.
- **************************************************************************
- */
-NSPR_API(PRFileDesc*) PR_PopIOLayer(PRFileDesc *fd_stack, PRDescIdentity id);
-
-/*
- **************************************************************************
  * FUNCTION:    PR_Open
  * DESCRIPTION:    Open a file for reading, writing, or both.
@@ -763,59 +621,4 @@
 NSPR_API(PRInt32) PR_Write(PRFileDesc *fd,const void *buf,PRInt32 amount);
 
-/*
- ***************************************************************************
- * FUNCTION: PR_Writev
- * DESCRIPTION:
- *     Write data to a socket.  The data is organized in a PRIOVec array. The
- *     operation will block until all the data is written or the operation
- *     fails.
- * INPUTS:
- *     PRFileDesc *fd
- *         Pointer that points to a PRFileDesc object for a socket.
- *     const PRIOVec *iov
- *         An array of PRIOVec.  PRIOVec is a struct with the following
- *         two fields:
- *             char *iov_base;
- *             int iov_len;
- *     PRInt32 iov_size
- *         Number of elements in the iov array. The value of this
- *         argument must not be greater than PR_MAX_IOVECTOR_SIZE.
- *         If it is, the method will fail (PR_BUFFER_OVERFLOW_ERROR).
- *     PRIntervalTime timeout
- *       Time limit for completion of the entire write operation.
- * OUTPUTS:
- *     None
- * RETURN:
- *     A positive number indicates the number of bytes successfully written.
- *     A -1 is an indication that the operation failed. The reason
- *     for the failure is obtained by calling PR_GetError().
- ***************************************************************************
- */
-
-#define PR_MAX_IOVECTOR_SIZE 16   /* 'iov_size' must be <= */
-
-NSPR_API(PRInt32) PR_Writev(
-    PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size,
-    PRIntervalTime timeout);
-
-/*
- ***************************************************************************
- * FUNCTION: PR_Delete
- * DESCRIPTION:
- *     Delete a file from the filesystem. The operation may fail if the
- *     file is open.
- * INPUTS:
- *     const char *name
- *         Path name of the file to be deleted.
- * OUTPUTS:
- *     None.
- * RETURN: PRStatus
- *     The function returns PR_SUCCESS if the file is successfully
- *     deleted, otherwise it returns PR_FAILURE.
- ***************************************************************************
- */
-
-NSPR_API(PRStatus) PR_Delete(const char *name);
-
 /**************************************************************************/
 
@@ -861,24 +664,4 @@
 NSPR_API(PRStatus) PR_GetFileInfo(const char *fn, PRFileInfo *info);
 NSPR_API(PRStatus) PR_GetFileInfo64(const char *fn, PRFileInfo64 *info);
-
-/*
- **************************************************************************
- * FUNCTION: PR_GetOpenFileInfo, PR_GetOpenFileInfo64
- * DESCRIPTION:
- *     Get information about an open file referred to by the
- *     given PRFileDesc object.
- * INPUTS:
- *     const PRFileDesc *fd
- *          A reference to a valid, open file.
- * OUTPUTS:
- *     Same as PR_GetFileInfo, PR_GetFileInfo64
- * RETURN: PRStatus
- *     PR_GetFileInfo returns PR_SUCCESS if file information is successfully
- *     obtained, otherwise it returns PR_FAILURE.
- ***************************************************************************
- */
-
-NSPR_API(PRStatus) PR_GetOpenFileInfo(PRFileDesc *fd, PRFileInfo *info);
-NSPR_API(PRStatus) PR_GetOpenFileInfo64(PRFileDesc *fd, PRFileInfo64 *info);
 
 /*
@@ -918,512 +701,4 @@
 NSPR_API(PROffset64) PR_Seek64(PRFileDesc *fd, PROffset64 offset, PRSeekWhence whence);
 
-/*
- ************************************************************************
- * FUNCTION: PR_Available
- * DESCRIPTION:
- *     Determine the amount of data in bytes available for reading
- *     in the given file or socket.
- * INPUTS:
- *     PRFileDesc *fd
- *         Pointer to a PRFileDesc object that refers to a file or
- *         socket.
- * OUTPUTS:
- *     None
- * RETURN: PRInt32, PRInt64
- *     Upon successful completion, PR_Available returns the number of
- *     bytes beyond the current read pointer that is available for
- *     reading.  Otherwise, it returns a -1 and the reason for the
- *     failure can be retrieved via PR_GetError().
- ************************************************************************
- */
-
-NSPR_API(PRInt32) PR_Available(PRFileDesc *fd);
-
-/*
- ************************************************************************
- * FUNCTION: PR_Sync
- * DESCRIPTION:
- *     Sync any buffered data for a fd to its backing device (disk).
- * INPUTS:
- *     PRFileDesc *fd
- *         Pointer to a PRFileDesc object that refers to a file or
- *         socket
- * OUTPUTS:
- *     None
- * RETURN: PRStatus
- *     PR_SUCCESS is returned if the requested access is permitted.
- *     Otherwise, PR_FAILURE is returned.
- ************************************************************************
- */
-
-NSPR_API(PRStatus)	PR_Sync(PRFileDesc *fd);
-
-/*
- *************************************************************************
- * FUNCTION: PR_OpenTCPSocket
- * DESCRIPTION:
- *     Create a new TCP socket of the specified address family.
- * INPUTS:
- *     PRIntn af
- *       Address family
- * OUTPUTS:
- *     None
- * RETURN: PRFileDesc*
- *     Upon successful completion, PR_NewTCPSocket returns a pointer
- *     to the PRFileDesc created for the newly opened TCP socket.
- *     Returns a NULL pointer if the creation of a new TCP socket failed.
- *
- **************************************************************************
- */
-
-NSPR_API(PRFileDesc*)    PR_OpenTCPSocket(PRIntn af);
-
-/*
- *************************************************************************
- * FUNCTION: PR_Connect
- * DESCRIPTION:
- *     Initiate a connection on a socket.
- * INPUTS:
- *     PRFileDesc *fd
- *       Points to a PRFileDesc object representing a socket
- *     PRNetAddr *addr
- *       Specifies the address of the socket in its own communication
- *       space.
- *     PRIntervalTime timeout
- *       Time limit for completion of the connect operation.
- * OUTPUTS:
- *     None
- * RETURN: PRStatus
- *     Upon successful completion of connection initiation, PR_Connect
- *     returns PR_SUCCESS.  Otherwise, it returns PR_FAILURE.  Further
- *     failure information can be obtained by calling PR_GetError().
- **************************************************************************
- */
-
-NSPR_API(PRStatus) PR_Connect(
-    PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout);
-
-/*
- *************************************************************************
- * FUNCTION: PR_ConnectContinue
- * DESCRIPTION:
- *     Continue a nonblocking connect.  After a nonblocking connect
- *     is initiated with PR_Connect() (which fails with
- *     PR_IN_PROGRESS_ERROR), one should call PR_Poll() on the socket,
- *     with the in_flags PR_POLL_WRITE | PR_POLL_EXCEPT.  When
- *     PR_Poll() returns, one calls PR_ConnectContinue() on the
- *     socket to determine whether the nonblocking connect has
- *     completed or is still in progress.  Repeat the PR_Poll(),
- *     PR_ConnectContinue() sequence until the nonblocking connect
- *     has completed.
- * INPUTS:
- *     PRFileDesc *fd
- *         the file descriptor representing a socket
- *     PRInt16 out_flags
- *         the out_flags field of the poll descriptor returned by
- *         PR_Poll()
- * RETURN: PRStatus
- *     If the nonblocking connect has successfully completed,
- *     PR_ConnectContinue returns PR_SUCCESS.  If PR_ConnectContinue()
- *     returns PR_FAILURE, call PR_GetError():
- *     - PR_IN_PROGRESS_ERROR: the nonblocking connect is still in
- *       progress and has not completed yet.  The caller should poll
- *       on the file descriptor for the in_flags
- *       PR_POLL_WRITE|PR_POLL_EXCEPT and retry PR_ConnectContinue
- *       later when PR_Poll() returns.
- *     - Other errors: the nonblocking connect has failed with this
- *       error code.
- */
-
-NSPR_API(PRStatus)    PR_ConnectContinue(PRFileDesc *fd, PRInt16 out_flags);
-
-/*
- *************************************************************************
- * THIS FUNCTION IS DEPRECATED.  USE PR_ConnectContinue INSTEAD.
- *
- * FUNCTION: PR_GetConnectStatus
- * DESCRIPTION:
- *     Get the completion status of a nonblocking connect.  After
- *     a nonblocking connect is initiated with PR_Connect() (which
- *     fails with PR_IN_PROGRESS_ERROR), one should call PR_Poll()
- *     on the socket, with the in_flags PR_POLL_WRITE | PR_POLL_EXCEPT.
- *     When PR_Poll() returns, one calls PR_GetConnectStatus on the
- *     PRPollDesc structure to determine whether the nonblocking
- *     connect has succeeded or failed.
- * INPUTS:
- *     const PRPollDesc *pd
- *         Pointer to a PRPollDesc whose fd member is the socket,
- *         and in_flags must contain PR_POLL_WRITE and PR_POLL_EXCEPT.
- *         PR_Poll() should have been called and set the out_flags.
- * RETURN: PRStatus
- *     If the nonblocking connect has successfully completed,
- *     PR_GetConnectStatus returns PR_SUCCESS.  If PR_GetConnectStatus()
- *     returns PR_FAILURE, call PR_GetError():
- *     - PR_IN_PROGRESS_ERROR: the nonblocking connect is still in
- *       progress and has not completed yet.
- *     - Other errors: the nonblocking connect has failed with this
- *       error code.
- */
-
-NSPR_API(PRStatus)    PR_GetConnectStatus(const PRPollDesc *pd);
-
-/*
- *************************************************************************
- * FUNCTION: PR_Accept
- * DESCRIPTION:
- *     Accept a connection on a socket.
- * INPUTS:
- *     PRFileDesc *fd
- *       Points to a PRFileDesc object representing the rendezvous socket
- *       on which the caller is willing to accept new connections.
- *     PRIntervalTime timeout
- *       Time limit for completion of the accept operation.
- * OUTPUTS:
- *     PRNetAddr *addr
- *       Returns the address of the connecting entity in its own
- *       communication space. It may be NULL.
- * RETURN: PRFileDesc*
- *     Upon successful acceptance of a connection, PR_Accept
- *     returns a valid file descriptor. Otherwise, it returns NULL.
- *     Further failure information can be obtained by calling PR_GetError().
- **************************************************************************
- */
-
-NSPR_API(PRFileDesc*) PR_Accept(
-    PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout);
-
-/*
- *************************************************************************
- * FUNCTION: PR_Bind
- * DESCRIPTION:
- *    Bind an address to a socket.
- * INPUTS:
- *     PRFileDesc *fd
- *       Points to a PRFileDesc object representing a socket.
- *     PRNetAddr *addr
- *       Specifies the address to which the socket will be bound.
- * OUTPUTS:
- *     None
- * RETURN: PRStatus
- *     Upon successful binding of an address to a socket, PR_Bind
- *     returns PR_SUCCESS.  Otherwise, it returns PR_FAILURE.  Further
- *     failure information can be obtained by calling PR_GetError().
- **************************************************************************
- */
-
-NSPR_API(PRStatus) PR_Bind(PRFileDesc *fd, const PRNetAddr *addr);
-
-/*
- *************************************************************************
- * FUNCTION: PR_Listen
- * DESCRIPTION:
- *    Listen for connections on a socket.
- * INPUTS:
- *     PRFileDesc *fd
- *       Points to a PRFileDesc object representing a socket that will be
- *       used to listen for new connections.
- *     PRIntn backlog
- *       Specifies the maximum length of the queue of pending connections.
- * OUTPUTS:
- *     None
- * RETURN: PRStatus
- *     Upon successful completion of listen request, PR_Listen
- *     returns PR_SUCCESS.  Otherwise, it returns PR_FAILURE.  Further
- *     failure information can be obtained by calling PR_GetError().
- **************************************************************************
- */
-
-NSPR_API(PRStatus) PR_Listen(PRFileDesc *fd, PRIntn backlog);
-
-/*
- *************************************************************************
- * FUNCTION: PR_Shutdown
- * DESCRIPTION:
- *    Shut down part of a full-duplex connection on a socket.
- * INPUTS:
- *     PRFileDesc *fd
- *       Points to a PRFileDesc object representing a connected socket.
- *     PRIntn how
- *       Specifies the kind of disallowed operations on the socket.
- *           PR_SHUTDOWN_RCV - Further receives will be disallowed
- *           PR_SHUTDOWN_SEND - Further sends will be disallowed
- *           PR_SHUTDOWN_BOTH - Further sends and receives will be disallowed
- * OUTPUTS:
- *     None
- * RETURN: PRStatus
- *     Upon successful completion of shutdown request, PR_Shutdown
- *     returns PR_SUCCESS.  Otherwise, it returns PR_FAILURE.  Further
- *     failure information can be obtained by calling PR_GetError().
- **************************************************************************
- */
-
-typedef enum PRShutdownHow
-{
-    PR_SHUTDOWN_RCV = 0,      /* disallow further receives */
-    PR_SHUTDOWN_SEND = 1,     /* disallow further sends */
-    PR_SHUTDOWN_BOTH = 2      /* disallow further receives and sends */
-} PRShutdownHow;
-
-NSPR_API(PRStatus)    PR_Shutdown(PRFileDesc *fd, PRShutdownHow how);
-
-/*
- *************************************************************************
- * FUNCTION: PR_Recv
- * DESCRIPTION:
- *    Receive a specified number of bytes from a connected socket.
- *     The operation will block until some positive number of bytes are 
- *     transferred, a time out has occurred, or there is an error. 
- *     No more than 'amount' bytes will be transferred.
- * INPUTS:
- *     PRFileDesc *fd
- *       points to a PRFileDesc object representing a socket.
- *     void *buf
- *       pointer to a buffer to hold the data received.
- *     PRInt32 amount
- *       the size of 'buf' (in bytes)
- *     PRIntn flags
- *       must be zero or PR_MSG_PEEK.
- *     PRIntervalTime timeout
- *       Time limit for completion of the receive operation.
- * OUTPUTS:
- *     None
- * RETURN: PRInt32
- *         a positive number indicates the number of bytes actually received.
- *         0 means the network connection is closed.
- *         -1 indicates a failure. The reason for the failure is obtained
- *         by calling PR_GetError().
- **************************************************************************
- */
-
-#define PR_MSG_PEEK 0x2
-
-NSPR_API(PRInt32)    PR_Recv(PRFileDesc *fd, void *buf, PRInt32 amount,
-                PRIntn flags, PRIntervalTime timeout);
-
-/*
- *************************************************************************
- * FUNCTION: PR_Send
- * DESCRIPTION:
- *    Send a specified number of bytes from a connected socket.
- *     The operation will block until all bytes are 
- *     processed, a time out has occurred, or there is an error. 
- * INPUTS:
- *     PRFileDesc *fd
- *       points to a PRFileDesc object representing a socket.
- *     void *buf
- *       pointer to a buffer from where the data is sent.
- *     PRInt32 amount
- *       the size of 'buf' (in bytes)
- *     PRIntn flags
- *        (OBSOLETE - must always be zero)
- *     PRIntervalTime timeout
- *       Time limit for completion of the send operation.
- * OUTPUTS:
- *     None
- * RETURN: PRInt32
- *     A positive number indicates the number of bytes successfully processed.
- *     This number must always equal 'amount'. A -1 is an indication that the
- *     operation failed. The reason for the failure is obtained by calling
- *     PR_GetError().
- **************************************************************************
- */
-
-NSPR_API(PRInt32)    PR_Send(PRFileDesc *fd, const void *buf, PRInt32 amount,
-                                PRIntn flags, PRIntervalTime timeout);
-
-/*
-*************************************************************************
-** FUNCTION: PR_GetSockName
-** DESCRIPTION:
-**    Get socket name.  Return the network address for this socket.
-**
-** INPUTS:
-**     PRFileDesc *fd
-**       Points to a PRFileDesc object representing the socket.
-** OUTPUTS:
-**     PRNetAddr *addr
-**       Returns the address of the socket in its own communication space.
-** RETURN: PRStatus
-**     Upon successful completion, PR_GetSockName returns PR_SUCCESS.  
-**     Otherwise, it returns PR_FAILURE.  Further failure information can 
-**     be obtained by calling PR_GetError().
-**************************************************************************
-**/
-NSPR_API(PRStatus)	PR_GetSockName(PRFileDesc *fd, PRNetAddr *addr);
-
-/*
-*************************************************************************
-** FUNCTION: PR_GetPeerName
-** DESCRIPTION:
-**    Get name of the connected peer.  Return the network address for the 
-**    connected peer socket.
-**
-** INPUTS:
-**     PRFileDesc *fd
-**       Points to a PRFileDesc object representing the connected peer.
-** OUTPUTS:
-**     PRNetAddr *addr
-**       Returns the address of the connected peer in its own communication
-**       space.
-** RETURN: PRStatus
-**     Upon successful completion, PR_GetPeerName returns PR_SUCCESS.  
-**     Otherwise, it returns PR_FAILURE.  Further failure information can 
-**     be obtained by calling PR_GetError().
-**************************************************************************
-**/
-NSPR_API(PRStatus)	PR_GetPeerName(PRFileDesc *fd, PRNetAddr *addr);
-
-NSPR_API(PRStatus)	PR_GetSocketOption(
-    PRFileDesc *fd, PRSocketOptionData *data);
-
-NSPR_API(PRStatus)	PR_SetSocketOption(
-    PRFileDesc *fd, const PRSocketOptionData *data);
-
-/*
- *********************************************************************
- *
- * File descriptor inheritance
- *
- *********************************************************************
- */
-
-/*
- ************************************************************************
- * FUNCTION: PR_SetFDInheritable
- * DESCRIPTION:
- *    Set the inheritance attribute of a file descriptor.
- *
- * INPUTS:
- *     PRFileDesc *fd
- *       Points to a PRFileDesc object.
- *     PRBool inheritable
- *       If PR_TRUE, the file descriptor fd is set to be inheritable
- *       by a child process.  If PR_FALSE, the file descriptor is set
- *       to be not inheritable by a child process.
- * RETURN: PRStatus
- *     Upon successful completion, PR_SetFDInheritable returns PR_SUCCESS.  
- *     Otherwise, it returns PR_FAILURE.  Further failure information can 
- *     be obtained by calling PR_GetError().
- *************************************************************************
- */
-NSPR_API(PRStatus) PR_SetFDInheritable(
-    PRFileDesc *fd,
-    PRBool inheritable);
-
-/*
- ************************************************************************
- * FUNCTION: PR_GetInheritedFD
- * DESCRIPTION:
- *    Get an inherited file descriptor with the specified name.
- *
- * INPUTS:
- *     const char *name
- *       The name of the inherited file descriptor.
- * RETURN: PRFileDesc *
- *     Upon successful completion, PR_GetInheritedFD returns the
- *     inherited file descriptor with the specified name.  Otherwise,  
- *     it returns NULL.  Further failure information can be obtained
- *     by calling PR_GetError().
- *************************************************************************
- */
-NSPR_API(PRFileDesc *) PR_GetInheritedFD(const char *name);
-
-/*
- ******************************************************************
- *
- * Interprocess communication
- *
- ******************************************************************
- */
-
-/*
- * Creates an anonymous pipe and returns file descriptors for the
- * read and write ends of the pipe.
- */
-
-NSPR_API(PRStatus) PR_CreatePipe(
-    PRFileDesc **readPipe,
-    PRFileDesc **writePipe
-);
-
-/************************************************************************/
-/************** The following definitions are for poll ******************/
-/************************************************************************/
-
-struct PRPollDesc {
-    PRFileDesc* fd;
-    PRInt16 in_flags;
-    PRInt16 out_flags;
-};
-
-/*
-** Bit values for PRPollDesc.in_flags or PRPollDesc.out_flags. Binary-or
-** these together to produce the desired poll request.
-*/
-
-#if defined(_PR_POLL_BACKCOMPAT)
-
-#include <poll.h>
-#define PR_POLL_READ    POLLIN
-#define PR_POLL_WRITE   POLLOUT
-#define PR_POLL_EXCEPT  POLLPRI
-#define PR_POLL_ERR     POLLERR     /* only in out_flags */
-#define PR_POLL_NVAL    POLLNVAL    /* only in out_flags when fd is bad */
-#define PR_POLL_HUP     POLLHUP     /* only in out_flags */
-
-#else  /* _PR_POLL_BACKCOMPAT */
-
-#define PR_POLL_READ    0x1
-#define PR_POLL_WRITE   0x2
-#define PR_POLL_EXCEPT  0x4
-#define PR_POLL_ERR     0x8         /* only in out_flags */
-#define PR_POLL_NVAL    0x10        /* only in out_flags when fd is bad */
-#define PR_POLL_HUP     0x20        /* only in out_flags */
-
-#endif  /* _PR_POLL_BACKCOMPAT */
-
-/*
-*************************************************************************
-** FUNCTION:    PR_Poll
-** DESCRIPTION:
-**
-** The call returns as soon as I/O is ready on one or more of the underlying
-** socket objects. A count of the number of ready descriptors is
-** returned unless a timeout occurs in which case zero is returned.
-**
-** PRPollDesc.fd should be set to a pointer to a PRFileDesc object
-** representing a socket. This field can be set to NULL to indicate to
-** PR_Poll that this PRFileDesc object should be ignored.
-** PRPollDesc.in_flags should be set to the desired request
-** (read/write/except or some combination). Upon successful return from
-** this call PRPollDesc.out_flags will be set to indicate what kind of
-** i/o can be performed on the respective descriptor. PR_Poll() uses the
-** out_flags fields as scratch variables during the call. If PR_Poll()
-** returns 0 or -1, the out_flags fields do not contain meaningful values
-** and must not be used.
-**
-** INPUTS:
-**      PRPollDesc *pds         A pointer to an array of PRPollDesc
-**
-**      PRIntn npds             The number of elements in the array
-**                              If this argument is zero PR_Poll is
-**                              equivalent to a PR_Sleep(timeout).
-**
-**      PRIntervalTime timeout  Amount of time the call will block waiting
-**                              for I/O to become ready. If this time expires
-**                              w/o any I/O becoming ready, the result will
-**                              be zero.
-**
-** OUTPUTS:    None
-** RETURN:
-**      PRInt32                 Number of PRPollDesc's with events or zero
-**                              if the function timed out or -1 on failure.
-**                              The reason for the failure is obtained by
-**                              calling PR_GetError().
-**************************************************************************
-*/
-NSPR_API(PRInt32) PR_Poll(
-    PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout);
-
 PR_END_EXTERN_C
 
Index: trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/priometh.c
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/priometh.c	(revision 102051)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/priometh.c	(revision 102063)
@@ -172,81 +172,3 @@
 }
 
-PR_IMPLEMENT(PRStatus) PR_Connect(
-    PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout)
-{
-	return((fd->methods->connect)(fd,addr,timeout));
-}
-
-PR_IMPLEMENT(PRStatus) PR_ConnectContinue(
-    PRFileDesc *fd, PRInt16 out_flags)
-{
-	return((fd->methods->connectcontinue)(fd,out_flags));
-}
-
-PR_IMPLEMENT(PRFileDesc*) PR_Accept(PRFileDesc *fd, PRNetAddr *addr,
-PRIntervalTime timeout)
-{
-	return((fd->methods->accept)(fd,addr,timeout));
-}
-
-PR_IMPLEMENT(PRStatus) PR_Bind(PRFileDesc *fd, const PRNetAddr *addr)
-{
-	return((fd->methods->bind)(fd,addr));
-}
-
-PR_IMPLEMENT(PRStatus) PR_Shutdown(PRFileDesc *fd, PRShutdownHow how)
-{
-	return((fd->methods->shutdown)(fd,how));
-}
-
-PR_IMPLEMENT(PRStatus) PR_Listen(PRFileDesc *fd, PRIntn backlog)
-{
-	return((fd->methods->listen)(fd,backlog));
-}
-
-PR_IMPLEMENT(PRInt32) PR_Recv(PRFileDesc *fd, void *buf, PRInt32 amount,
-PRIntn flags, PRIntervalTime timeout)
-{
-	return((fd->methods->recv)(fd,buf,amount,flags,timeout));
-}
-
-PR_IMPLEMENT(PRInt32) PR_Send(PRFileDesc *fd, const void *buf, PRInt32 amount,
-PRIntn flags, PRIntervalTime timeout)
-{
-	return((fd->methods->send)(fd,buf,amount,flags,timeout));
-}
-
-PR_IMPLEMENT(PRInt32) PR_Writev(PRFileDesc *fd, const PRIOVec *iov,
-PRInt32 iov_size, PRIntervalTime timeout)
-{
-    if (iov_size > PR_MAX_IOVECTOR_SIZE)
-    {
-        PR_SetError(PR_BUFFER_OVERFLOW_ERROR, 0);
-        return -1;
-    }
-	return((fd->methods->writev)(fd,iov,iov_size,timeout));
-}
-
-PR_IMPLEMENT(PRStatus) PR_GetSockName(PRFileDesc *fd, PRNetAddr *addr)
-{
-	return((fd->methods->getsockname)(fd,addr));
-}
-
-PR_IMPLEMENT(PRStatus) PR_GetPeerName(PRFileDesc *fd, PRNetAddr *addr)
-{
-	return((fd->methods->getpeername)(fd,addr));
-}
-
-PR_IMPLEMENT(PRStatus) PR_GetSocketOption(
-    PRFileDesc *fd, PRSocketOptionData *data)
-{
-	return((fd->methods->getsocketoption)(fd, data));
-}
-
-PR_IMPLEMENT(PRStatus) PR_SetSocketOption(
-    PRFileDesc *fd, const PRSocketOptionData *data)
-{
-	return((fd->methods->setsocketoption)(fd, data));
-}
-
 /* priometh.c */
Index: trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/prstdio.c
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/prstdio.c	(revision 102051)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/prstdio.c	(revision 102063)
@@ -60,43 +60,5 @@
     char* msg = PR_vsmprintf(fmt, ap);
     len = strlen(msg);
-#ifdef XP_OS2
-    /*
-     * OS/2 really needs a \r for every \n.
-     * In the future we should try to use scatter-gather instead of a
-     * succession of PR_Write.
-     */
-    if (isatty(PR_FileDesc2NativeHandle(fd))) {
-        PRUint32 last = 0, idx;
-        PRInt32 tmp;
-        rv = 0;
-        for (idx = 0; idx < len+1; idx++) {
-            if ((idx - last > 0) && (('\n' == msg[idx]) || (idx == len))) {
-                tmp = PR_Write(fd, msg + last, idx - last);
-                if (tmp >= 0) {
-                    rv += tmp;
-                }
-                last = idx;
-            }
-            /*
-             * if current character is \n, and
-             * previous character isn't \r, and
-             * next character isn't \r
-             */
-            if (('\n' == msg[idx]) &&
-                ((0 == idx) || ('\r' != msg[idx-1])) &&
-                ('\r' != msg[idx+1])) {
-                /* add extra \r */
-                tmp = PR_Write(fd, "\r", 1);
-                if (tmp >= 0) {
-                    rv += tmp;
-                }
-            }
-        }
-    } else {
-        rv = PR_Write(fd, msg, len);
-    }
-#else
     rv = PR_Write(fd, msg, len);
-#endif
     PR_DELETE(msg);
     return rv;
Index: trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptio.c
===================================================================
--- trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptio.c	(revision 102051)
+++ trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptio.c	(revision 102063)
@@ -71,98 +71,10 @@
 #endif
 
-#include <netinet/tcp.h>  /* TCP_NODELAY, TCP_MAXSEG */
-#ifdef LINUX
-/* TCP_CORK is not defined in <netinet/tcp.h> on Red Hat Linux 6.0 */
-#ifndef TCP_CORK
-#define TCP_CORK 3
-#endif
-#endif
-
 #include <iprt/assert.h>
 #include <iprt/thread.h>
 
-#ifdef DARWIN
-static PRBool _pr_ipv6_v6only_on_by_default;
-/* The IPV6_V6ONLY socket option is not defined on Mac OS X 10.1. */
-#ifndef IPV6_V6ONLY
-#define IPV6_V6ONLY 27
-#endif
-#endif
-
-#if defined(SOLARIS)
-#define _PRSockOptVal_t char *
-#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(HPUX) \
-    || defined(LINUX) || defined(FREEBSD) || defined(BSDI) || defined(VMS) \
-    || defined(NTO) || defined(OPENBSD) || defined(DARWIN) \
-    || defined(UNIXWARE) || defined(NETBSD)
-#define _PRSockOptVal_t void *
-#else
-#error "Cannot determine architecture"
-#endif
-
-#if (defined(HPUX) && !defined(HPUX10_30) && !defined(HPUX11))
-#define _PRSelectFdSetArg_t int *
-#elif defined(AIX4_1)
-#define _PRSelectFdSetArg_t void *
-#elif defined(IRIX) || (defined(AIX) && !defined(AIX4_1)) \
-    || defined(OSF1) || defined(SOLARIS) \
-    || defined(HPUX10_30) || defined(HPUX11) || defined(LINUX) \
-    || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
-    || defined(BSDI) || defined(VMS) || defined(NTO) || defined(DARWIN) \
-    || defined(UNIXWARE)
-#define _PRSelectFdSetArg_t fd_set *
-#else
-#error "Cannot determine architecture"
-#endif
-
-static PRFileDesc *pt_SetMethods(
-    PRIntn osfd, PRDescType type, PRBool isAcceptedSocket, PRBool imported);
-
 static PRLock *_pr_rename_lock;  /* For PR_Rename() */
 
 /**************************************************************************/
-
-/* These two functions are only used in assertions. */
-#ifdef RT_STRICT
-
-PRBool IsValidNetAddr(const PRNetAddr *addr)
-{
-    if ((addr != NULL)
-            && (addr->raw.family != AF_UNIX)
-            && (addr->raw.family != PR_AF_INET6)
-            && (addr->raw.family != AF_INET)) {
-        return PR_FALSE;
-    }
-    return PR_TRUE;
-}
-
-static PRBool IsValidNetAddrLen(const PRNetAddr *addr, PRInt32 addr_len)
-{
-    /*
-     * The definition of the length of a Unix domain socket address
-     * is not uniform, so we don't check it.
-     */
-    if ((addr != NULL)
-            && (addr->raw.family != AF_UNIX)
-            && (PR_NETADDR_SIZE(addr) != addr_len)) {
-#if defined(LINUX) && __GLIBC__ == 2 && __GLIBC_MINOR__ == 1
-        /*
-         * In glibc 2.1, struct sockaddr_in6 is 24 bytes.  In glibc 2.2
-         * and in the 2.4 kernel, struct sockaddr_in6 has the scope_id
-         * field and is 28 bytes.  It is possible for socket functions
-         * to return an addr_len greater than sizeof(struct sockaddr_in6).
-         * We need to allow that.  (Bugzilla bug #77264)
-         */
-        if ((PR_AF_INET6 == addr->raw.family)
-                && (sizeof(addr->ipv6) == addr_len)) {
-            return PR_TRUE;
-        }
-#endif
-        return PR_FALSE;
-    }
-    return PR_TRUE;
-}
-
-#endif /* DEBUG */
 
 /*****************************************************************************/
@@ -175,21 +87,4 @@
  */
 #define PT_DEFAULT_POLL_MSEC 5000
-
-/*
- * pt_SockLen is the type for the length of a socket address
- * structure, used in the address length argument to bind,
- * connect, accept, getsockname, getpeername, etc.  Posix.1g
- * defines this type as socklen_t.  It is size_t or int on
- * most current systems.
- */
-#if defined(HAVE_SOCKLEN_T) \
-    || (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
-typedef socklen_t pt_SockLen;
-#elif (defined(AIX) && !defined(AIX4_1)) \
-    || defined(VMS)
-typedef PRSize pt_SockLen;
-#else
-typedef PRIntn pt_SockLen;
-#endif
 
 typedef struct pt_Continuation pt_Continuation;
@@ -210,5 +105,4 @@
     union {
         PRSize amount;                      /* #3 - size of 'buffer', or */
-        pt_SockLen *addr_len;                  /*    - length of address */
     } arg3;
     union { PRIntn flags; } arg4;           /* #4 - read/write flags */
@@ -290,5 +184,4 @@
     fd->dtor = NULL;
     fd->lower = fd->higher = NULL;
-    fd->identity = PR_NSPR_IO_LAYER;
     memset(fd->secret, 0, sizeof(PRFilePrivate));
     return fd;
@@ -453,29 +346,4 @@
 /*********************** specific continuation functions *********************/
 /*****************************************************************************/
-static PRBool pt_connect_cont(pt_Continuation *op, PRInt16 revents)
-{
-    op->syserrno = _MD_unix_get_nonblocking_connect_error(op->arg1.osfd);
-    if (op->syserrno != 0) {
-        op->result.code = -1;
-    } else {
-        op->result.code = 0;
-    }
-    return PR_TRUE; /* this one is cooked */
-}  /* pt_connect_cont */
-
-static PRBool pt_accept_cont(pt_Continuation *op, PRInt16 revents)
-{
-    op->syserrno = 0;
-    op->result.code = accept(
-        op->arg1.osfd, op->arg2.buffer, op->arg3.addr_len);
-    if (-1 == op->result.code)
-    {
-        op->syserrno = errno;
-        if (EWOULDBLOCK == errno || EAGAIN == errno || ECONNABORTED == errno)
-            return PR_FALSE;  /* do nothing - this one ain't finished */
-    }
-    return PR_TRUE;
-}  /* pt_accept_cont */
-
 static PRBool pt_read_cont(pt_Continuation *op, PRInt16 revents)
 {
@@ -492,82 +360,4 @@
         PR_FALSE : PR_TRUE;
 }  /* pt_read_cont */
-
-static PRBool pt_recv_cont(pt_Continuation *op, PRInt16 revents)
-{
-    /*
-     * Any number of bytes will complete the operation. It need
-     * not (and probably will not) satisfy the request. The only
-     * error we continue is EWOULDBLOCK|EAGAIN.
-     */
-#if defined(SOLARIS)
-    if (0 == op->arg4.flags)
-        op->result.code = read(
-            op->arg1.osfd, op->arg2.buffer, op->arg3.amount);
-    else
-        op->result.code = recv(
-            op->arg1.osfd, op->arg2.buffer, op->arg3.amount, op->arg4.flags);
-#else
-    op->result.code = recv(
-        op->arg1.osfd, op->arg2.buffer, op->arg3.amount, op->arg4.flags);
-#endif
-    op->syserrno = errno;
-    return ((-1 == op->result.code) &&
-            (EWOULDBLOCK == op->syserrno || EAGAIN == op->syserrno)) ?
-        PR_FALSE : PR_TRUE;
-}  /* pt_recv_cont */
-
-static PRBool pt_send_cont(pt_Continuation *op, PRInt16 revents)
-{
-    PRIntn bytes;
-#if defined(SOLARIS)
-    PRInt32 tmp_amount = op->arg3.amount;
-#endif
-    /*
-     * We want to write the entire amount out, no matter how many
-     * tries it takes. Keep advancing the buffer and the decrementing
-     * the amount until the amount goes away. Return the total bytes
-     * (which should be the original amount) when finished (or an
-     * error).
-     */
-#if defined(SOLARIS)
-retry:
-    bytes = write(op->arg1.osfd, op->arg2.buffer, tmp_amount);
-#else
-    bytes = send(
-        op->arg1.osfd, op->arg2.buffer, op->arg3.amount, op->arg4.flags);
-#endif
-    op->syserrno = errno;
-
-#if defined(SOLARIS)
-    /*
-     * The write system call has been reported to return the ERANGE error
-     * on occasion. Try to write in smaller chunks to workaround this bug.
-     */
-    if ((bytes == -1) && (op->syserrno == ERANGE))
-    {
-        if (tmp_amount > 1)
-        {
-            tmp_amount = tmp_amount/2;  /* half the bytes */
-            goto retry;
-        }
-    }
-#endif
-
-    if (bytes >= 0)  /* this is progress */
-    {
-        char *bp = (char*)op->arg2.buffer;
-        bp += bytes;  /* adjust the buffer pointer */
-        op->arg2.buffer = bp;
-        op->result.code += bytes;  /* accumulate the number sent */
-        op->arg3.amount -= bytes;  /* and reduce the required count */
-        return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE;
-    }
-    else if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
-    {
-        op->result.code = -1;
-        return PR_TRUE;
-    }
-    else return PR_FALSE;
-}  /* pt_send_cont */
 
 static PRBool pt_write_cont(pt_Continuation *op, PRInt16 revents)
@@ -651,41 +441,8 @@
     _pr_rename_lock = PR_NewLock();
     Assert(NULL != _pr_rename_lock);
-
-    _pr_stdin = pt_SetMethods(0, PR_DESC_FILE, PR_FALSE, PR_TRUE);
-    _pr_stdout = pt_SetMethods(1, PR_DESC_FILE, PR_FALSE, PR_TRUE);
-    _pr_stderr = pt_SetMethods(2, PR_DESC_FILE, PR_FALSE, PR_TRUE);
-    Assert(_pr_stdin && _pr_stdout && _pr_stderr);
-
-#ifdef DARWIN
-    /* In Mac OS X v10.3 Panther Beta the IPV6_V6ONLY socket option
-     * is turned on by default, contrary to what RFC 3493, Section
-     * 5.3 says.  So we have to turn it off.  Find out whether we
-     * are running on such a system.
-     */
-    {
-        int osfd;
-        osfd = socket(AF_INET6, SOCK_STREAM, 0);
-        if (osfd != -1) {
-            int on;
-            int optlen = sizeof(on);
-            if (getsockopt(osfd, IPPROTO_IPV6, IPV6_V6ONLY,
-                    &on, &optlen) == 0) {
-                _pr_ipv6_v6only_on_by_default = on;
-            }
-            close(osfd);
-        }
-    }
-#endif
 }  /* _PR_InitIO */
 
 void _PR_CleanupIO(void)
 {
-    _PR_Putfd(_pr_stdin);
-    _pr_stdin = NULL;
-    _PR_Putfd(_pr_stdout);
-    _pr_stdout = NULL;
-    _PR_Putfd(_pr_stderr);
-    _pr_stderr = NULL;
-
     if (_pr_rename_lock)
     {
@@ -694,22 +451,4 @@
     }
 }  /* _PR_CleanupIO */
-
-PR_IMPLEMENT(PRFileDesc*) PR_GetSpecialFD(PRSpecialFD osfd)
-{
-    PRFileDesc *result = NULL;
-    Assert(osfd >= PR_StandardInput && osfd <= PR_StandardError);
-
-    if (!_pr_initialized) _PR_ImplicitInitialization();
-
-    switch (osfd)
-    {
-        case PR_StandardInput: result = _pr_stdin; break;
-        case PR_StandardOutput: result = _pr_stdout; break;
-        case PR_StandardError: result = _pr_stderr; break;
-        default:
-            (void)PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
-    }
-    return result;
-}  /* PR_GetSpecialFD */
 
 /*****************************************************************************/
@@ -852,96 +591,4 @@
 }  /* pt_Write */
 
-static PRInt32 pt_Writev(
-    PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_len, PRIntervalTime timeout)
-{
-    PRIntn iov_index;
-    PRBool fNeedContinue = PR_FALSE;
-    PRInt32 syserrno, bytes, rv = -1;
-    struct iovec osiov_local[PR_MAX_IOVECTOR_SIZE], *osiov;
-    int osiov_len;
-
-    if (pt_TestAbort()) return rv;
-
-    /* Ensured by PR_Writev */
-    Assert(iov_len <= PR_MAX_IOVECTOR_SIZE);
-
-    /*
-     * We can't pass iov to writev because PRIOVec and struct iovec
-     * may not be binary compatible.  Make osiov a copy of iov and
-     * pass osiov to writev.  We can modify osiov if we need to
-     * continue the operation.
-     */
-    osiov = osiov_local;
-    osiov_len = iov_len;
-    for (iov_index = 0; iov_index < osiov_len; iov_index++)
-    {
-        osiov[iov_index].iov_base = iov[iov_index].iov_base;
-        osiov[iov_index].iov_len = iov[iov_index].iov_len;
-    }
-
-    rv = bytes = writev(fd->secret->md.osfd, osiov, osiov_len);
-    syserrno = errno;
-
-    if (!fd->secret->nonblocking)
-    {
-        if (bytes >= 0)
-        {
-            /*
-             * If we moved some bytes, how does that implicate the
-             * i/o vector list?  In other words, exactly where are
-             * we within that array?  What are the parameters for
-             * resumption?  Maybe we're done!
-             */
-            for ( ;osiov_len > 0; osiov++, osiov_len--)
-            {
-                if (bytes < osiov->iov_len)
-                {
-                    /* this one's not done yet */
-                    osiov->iov_base = (char*)osiov->iov_base + bytes;
-                    osiov->iov_len -= bytes;
-                    break;  /* go off and do that */
-                }
-                bytes -= osiov->iov_len;  /* this one's done cooked */
-            }
-            Assert(osiov_len > 0 || bytes == 0);
-            if (osiov_len > 0)
-            {
-                if (PR_INTERVAL_NO_WAIT == timeout)
-                {
-                    rv = -1;
-                    syserrno = ETIMEDOUT;
-                }
-                else fNeedContinue = PR_TRUE;
-            }
-        }
-        else if (syserrno == EWOULDBLOCK || syserrno == EAGAIN)
-        {
-            if (PR_INTERVAL_NO_WAIT == timeout) syserrno = ETIMEDOUT;
-            else
-            {
-                rv = 0;
-                fNeedContinue = PR_TRUE;
-            }
-        }
-    }
-
-    if (fNeedContinue == PR_TRUE)
-    {
-        pt_Continuation op;
-
-        op.arg1.osfd = fd->secret->md.osfd;
-        op.arg2.buffer = (void*)osiov;
-        op.arg3.amount = osiov_len;
-        op.timeout = timeout;
-        op.result.code = rv;
-        op.function = pt_writev_cont;
-        op.event = POLLOUT | POLLPRI;
-        rv = pt_Continue(&op);
-        syserrno = op.syserrno;
-    }
-    if (rv == -1) pt_MapError(_PR_MD_MAP_WRITEV_ERROR, syserrno);
-    return rv;
-}  /* pt_Writev */
-
 static PRInt32 pt_Seek(PRFileDesc *fd, PRInt32 offset, PRSeekWhence whence)
 {
@@ -972,16 +619,4 @@
     return result;
 }  /* pt_Available_f */
-
-static PRInt32 pt_Available_s(PRFileDesc *fd)
-{
-    PRInt32 rv, bytes = -1;
-    if (pt_TestAbort()) return bytes;
-
-    rv = ioctl(fd->secret->md.osfd, FIONREAD, &bytes);
-
-    if (rv == -1)
-        pt_MapError(_PR_MD_MAP_SOCKETAVAILABLE_ERROR, errno);
-    return bytes;
-}  /* pt_Available_s */
 
 static PRStatus pt_FileInfo(PRFileDesc *fd, PRFileInfo *info)
@@ -996,9 +631,4 @@
     return (-1 == rv) ? PR_FAILURE : PR_SUCCESS;
 }  /* pt_FileInfo64 */
-
-static PRStatus pt_Synch(PRFileDesc *fd)
-{
-    return (NULL == fd) ? PR_FAILURE : PR_SUCCESS;
-} /* pt_Synch */
 
 static PRStatus pt_Fsync(PRFileDesc *fd)
@@ -1015,244 +645,4 @@
 }  /* pt_Fsync */
 
-static PRStatus pt_Connect(
-    PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout)
-{
-    PRIntn rv = -1, syserrno;
-    pt_SockLen addr_len;
-	const PRNetAddr *addrp = addr;
-#if defined(_PR_HAVE_SOCKADDR_LEN)
-	PRUint16 md_af = addr->raw.family;
-    PRNetAddr addrCopy;
-#endif
-
-    if (pt_TestAbort()) return PR_FAILURE;
-
-    Assert(IsValidNetAddr(addr) == PR_TRUE);
-    addr_len = PR_NETADDR_SIZE(addr);
-
-#ifdef _PR_HAVE_SOCKADDR_LEN
-    addrCopy = *addr;
-    ((struct sockaddr*)&addrCopy)->sa_len = addr_len;
-    ((struct sockaddr*)&addrCopy)->sa_family = md_af;
-    rv = connect(fd->secret->md.osfd, (struct sockaddr*)&addrCopy, addr_len);
-#else
-    rv = connect(fd->secret->md.osfd, (struct sockaddr*)addrp, addr_len);
-#endif
-    syserrno = errno;
-    if ((-1 == rv) && (EINPROGRESS == syserrno) && (!fd->secret->nonblocking))
-    {
-        if (PR_INTERVAL_NO_WAIT == timeout) syserrno = ETIMEDOUT;
-        else
-        {
-            pt_Continuation op;
-            op.arg1.osfd = fd->secret->md.osfd;
-#ifdef _PR_HAVE_SOCKADDR_LEN
-            op.arg2.buffer = (void*)&addrCopy;
-#else
-            op.arg2.buffer = (void*)addr;
-#endif
-            op.arg3.amount = addr_len;
-            op.timeout = timeout;
-            op.function = pt_connect_cont;
-            op.event = POLLOUT | POLLPRI;
-            rv = pt_Continue(&op);
-            syserrno = op.syserrno;
-        }
-    }
-    if (-1 == rv) {
-        pt_MapError(_PR_MD_MAP_CONNECT_ERROR, syserrno);
-        return PR_FAILURE;
-    }
-    return PR_SUCCESS;
-}  /* pt_Connect */
-
-static PRStatus pt_ConnectContinue(
-    PRFileDesc *fd, PRInt16 out_flags)
-{
-    int err;
-    PRInt32 osfd;
-
-    if (out_flags & PR_POLL_NVAL)
-    {
-        PR_SetError(PR_BAD_DESCRIPTOR_ERROR, 0);
-        return PR_FAILURE;
-    }
-    if ((out_flags & (PR_POLL_WRITE | PR_POLL_EXCEPT | PR_POLL_ERR)) == 0)
-    {
-        Assert(out_flags == 0);
-        PR_SetError(PR_IN_PROGRESS_ERROR, 0);
-        return PR_FAILURE;
-    }
-
-    osfd = fd->secret->md.osfd;
-
-    err = _MD_unix_get_nonblocking_connect_error(osfd);
-    if (err != 0)
-    {
-        _PR_MD_MAP_CONNECT_ERROR(err);
-        return PR_FAILURE;
-    }
-    return PR_SUCCESS;
-}  /* pt_ConnectContinue */
-
-PR_IMPLEMENT(PRStatus) PR_GetConnectStatus(const PRPollDesc *pd)
-{
-    /* Find the NSPR layer and invoke its connectcontinue method */
-    PRFileDesc *bottom = PR_GetIdentitiesLayer(pd->fd, PR_NSPR_IO_LAYER);
-
-    if (NULL == bottom)
-    {
-        PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
-        return PR_FAILURE;
-    }
-    return pt_ConnectContinue(bottom, pd->out_flags);
-}  /* PR_GetConnectStatus */
-
-static PRFileDesc* pt_Accept(
-    PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
-{
-    PRFileDesc *newfd = NULL;
-    PRIntn syserrno, osfd = -1;
-    pt_SockLen addr_len = sizeof(PRNetAddr);
-
-    if (pt_TestAbort()) return newfd;
-
-#ifdef _PR_STRICT_ADDR_LEN
-    if (addr)
-    {
-        /*
-         * Set addr->raw.family just so that we can use the
-         * PR_NETADDR_SIZE macro.
-         */
-        addr->raw.family = fd->secret->af;
-        addr_len = PR_NETADDR_SIZE(addr);
-    }
-#endif
-
-    osfd = accept(fd->secret->md.osfd, (struct sockaddr*)addr, &addr_len);
-    syserrno = errno;
-
-    if (osfd == -1)
-    {
-        if (fd->secret->nonblocking) goto failed;
-
-        if (EWOULDBLOCK != syserrno && EAGAIN != syserrno
-        && ECONNABORTED != syserrno)
-            goto failed;
-        else
-        {
-            if (PR_INTERVAL_NO_WAIT == timeout) syserrno = ETIMEDOUT;
-            else
-            {
-                pt_Continuation op;
-                op.arg1.osfd = fd->secret->md.osfd;
-                op.arg2.buffer = addr;
-                op.arg3.addr_len = &addr_len;
-                op.timeout = timeout;
-                op.function = pt_accept_cont;
-                op.event = POLLIN | POLLPRI;
-                osfd = pt_Continue(&op);
-                syserrno = op.syserrno;
-            }
-            if (osfd < 0) goto failed;
-        }
-    }
-#ifdef _PR_HAVE_SOCKADDR_LEN
-    /* ignore the sa_len field of struct sockaddr */
-    if (addr)
-    {
-        addr->raw.family = ((struct sockaddr*)addr)->sa_family;
-    }
-#endif /* _PR_HAVE_SOCKADDR_LEN */
-    newfd = pt_SetMethods(osfd, PR_DESC_SOCKET_TCP, PR_TRUE, PR_FALSE);
-    if (newfd == NULL) close(osfd);  /* $$$ whoops! this doesn't work $$$ */
-    else
-    {
-        Assert(IsValidNetAddr(addr) == PR_TRUE);
-        Assert(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
-#ifdef LINUX
-        /*
-         * On Linux, experiments showed that the accepted sockets
-         * inherit the TCP_NODELAY socket option of the listening
-         * socket.
-         */
-        newfd->secret->md.tcp_nodelay = fd->secret->md.tcp_nodelay;
-#endif
-    }
-    return newfd;
-
-failed:
-    pt_MapError(_PR_MD_MAP_ACCEPT_ERROR, syserrno);
-    return NULL;
-}  /* pt_Accept */
-
-static PRStatus pt_Bind(PRFileDesc *fd, const PRNetAddr *addr)
-{
-    PRIntn rv;
-    pt_SockLen addr_len;
-	const PRNetAddr *addrp = addr;
-#if defined(_PR_HAVE_SOCKADDR_LEN)
-	PRUint16 md_af = addr->raw.family;
-    PRNetAddr addrCopy;
-#endif
-
-    if (pt_TestAbort()) return PR_FAILURE;
-
-    Assert(IsValidNetAddr(addr) == PR_TRUE);
-    if (addr->raw.family == AF_UNIX)
-    {
-        /* Disallow relative pathnames */
-        if (addr->local.path[0] != '/')
-        {
-            PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
-            return PR_FAILURE;
-        }
-    }
-
-    addr_len = PR_NETADDR_SIZE(addr);
-#ifdef _PR_HAVE_SOCKADDR_LEN
-    addrCopy = *addr;
-    ((struct sockaddr*)&addrCopy)->sa_len = addr_len;
-    ((struct sockaddr*)&addrCopy)->sa_family = md_af;
-    rv = bind(fd->secret->md.osfd, (struct sockaddr*)&addrCopy, addr_len);
-#else
-    rv = bind(fd->secret->md.osfd, (struct sockaddr*)addrp, addr_len);
-#endif
-
-    if (rv == -1) {
-        pt_MapError(_PR_MD_MAP_BIND_ERROR, errno);
-        return PR_FAILURE;
-    }
-    return PR_SUCCESS;
-}  /* pt_Bind */
-
-static PRStatus pt_Listen(PRFileDesc *fd, PRIntn backlog)
-{
-    PRIntn rv;
-
-    if (pt_TestAbort()) return PR_FAILURE;
-
-    rv = listen(fd->secret->md.osfd, backlog);
-    if (rv == -1) {
-        pt_MapError(_PR_MD_MAP_LISTEN_ERROR, errno);
-        return PR_FAILURE;
-    }
-    return PR_SUCCESS;
-}  /* pt_Listen */
-
-static PRStatus pt_Shutdown(PRFileDesc *fd, PRIntn how)
-{
-    PRIntn rv = -1;
-    if (pt_TestAbort()) return PR_FAILURE;
-
-    rv = shutdown(fd->secret->md.osfd, how);
-
-    if (rv == -1) {
-        pt_MapError(_PR_MD_MAP_SHUTDOWN_ERROR, errno);
-        return PR_FAILURE;
-    }
-    return PR_SUCCESS;
-}  /* pt_Shutdown */
-
 static PRInt16 pt_Poll(PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
 {
@@ -1260,452 +650,4 @@
     return in_flags;
 }  /* pt_Poll */
-
-static PRInt32 pt_Recv(
-    PRFileDesc *fd, void *buf, PRInt32 amount,
-    PRIntn flags, PRIntervalTime timeout)
-{
-    PRInt32 syserrno, bytes = -1;
-    PRIntn osflags;
-
-    if (0 == flags)
-        osflags = 0;
-    else if (PR_MSG_PEEK == flags)
-        osflags = MSG_PEEK;
-    else
-    {
-        PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
-        return bytes;
-    }
-
-    if (pt_TestAbort()) return bytes;
-
-    /* recv() is a much slower call on pre-2.6 Solaris than read(). */
-#if defined(SOLARIS)
-    if (0 == osflags)
-        bytes = read(fd->secret->md.osfd, buf, amount);
-    else
-        bytes = recv(fd->secret->md.osfd, buf, amount, osflags);
-#else
-    bytes = recv(fd->secret->md.osfd, buf, amount, osflags);
-#endif
-    syserrno = errno;
-
-    if ((bytes == -1) && (syserrno == EWOULDBLOCK || syserrno == EAGAIN)
-        && (!fd->secret->nonblocking))
-    {
-        if (PR_INTERVAL_NO_WAIT == timeout) syserrno = ETIMEDOUT;
-        else
-        {
-            pt_Continuation op;
-            op.arg1.osfd = fd->secret->md.osfd;
-            op.arg2.buffer = buf;
-            op.arg3.amount = amount;
-            op.arg4.flags = osflags;
-            op.timeout = timeout;
-            op.function = pt_recv_cont;
-            op.event = POLLIN | POLLPRI;
-            bytes = pt_Continue(&op);
-            syserrno = op.syserrno;
-        }
-    }
-    if (bytes < 0)
-        pt_MapError(_PR_MD_MAP_RECV_ERROR, syserrno);
-    return bytes;
-}  /* pt_Recv */
-
-static PRInt32 pt_SocketRead(PRFileDesc *fd, void *buf, PRInt32 amount)
-{
-    return pt_Recv(fd, buf, amount, 0, PR_INTERVAL_NO_TIMEOUT);
-}  /* pt_SocketRead */
-
-static PRInt32 pt_Send(
-    PRFileDesc *fd, const void *buf, PRInt32 amount,
-    PRIntn flags, PRIntervalTime timeout)
-{
-    PRInt32 syserrno, bytes = -1;
-    PRBool fNeedContinue = PR_FALSE;
-#if defined(SOLARIS)
-	PRInt32 tmp_amount = amount;
-#endif
-
-    /*
-     * Under HP-UX DCE threads, pthread.h includes dce/cma_ux.h,
-     * which has the following:
-     *     #  define send        cma_send
-     *     extern int  cma_send (int , void *, int, int );
-     * So we need to cast away the 'const' of argument #2 for send().
-     */
-#if defined (HPUX) && defined(_PR_DCETHREADS)
-#define PT_SENDBUF_CAST (void *)
-#else
-#define PT_SENDBUF_CAST
-#endif
-
-    if (pt_TestAbort()) return bytes;
-
-    /*
-     * On pre-2.6 Solaris, send() is much slower than write().
-     * On 2.6 and beyond, with in-kernel sockets, send() and
-     * write() are fairly equivalent in performance.
-     */
-#if defined(SOLARIS)
-    Assert(0 == flags);
-retry:
-    bytes = write(fd->secret->md.osfd, PT_SENDBUF_CAST buf, tmp_amount);
-#else
-    bytes = send(fd->secret->md.osfd, PT_SENDBUF_CAST buf, amount, flags);
-#endif
-    syserrno = errno;
-
-#if defined(SOLARIS)
-    /*
-     * The write system call has been reported to return the ERANGE error
-     * on occasion. Try to write in smaller chunks to workaround this bug.
-     */
-    if ((bytes == -1) && (syserrno == ERANGE))
-    {
-        if (tmp_amount > 1)
-        {
-            tmp_amount = tmp_amount/2;  /* half the bytes */
-            goto retry;
-        }
-    }
-#endif
-
-    if ( (bytes >= 0) && (bytes < amount) && (!fd->secret->nonblocking) )
-    {
-        if (PR_INTERVAL_NO_WAIT == timeout)
-        {
-            bytes = -1;
-            syserrno = ETIMEDOUT;
-        }
-        else
-        {
-            buf = (char *) buf + bytes;
-            amount -= bytes;
-            fNeedContinue = PR_TRUE;
-        }
-    }
-    if ( (bytes == -1) && (syserrno == EWOULDBLOCK || syserrno == EAGAIN)
-        && (!fd->secret->nonblocking) )
-    {
-        if (PR_INTERVAL_NO_WAIT == timeout) syserrno = ETIMEDOUT;
-        else
-        {
-            bytes = 0;
-            fNeedContinue = PR_TRUE;
-        }
-    }
-
-    if (fNeedContinue == PR_TRUE)
-    {
-        pt_Continuation op;
-        op.arg1.osfd = fd->secret->md.osfd;
-        op.arg2.buffer = (void*)buf;
-        op.arg3.amount = amount;
-        op.arg4.flags = flags;
-        op.timeout = timeout;
-        op.result.code = bytes;  /* initialize the number sent */
-        op.function = pt_send_cont;
-        op.event = POLLOUT | POLLPRI;
-        bytes = pt_Continue(&op);
-        syserrno = op.syserrno;
-    }
-    if (bytes == -1)
-        pt_MapError(_PR_MD_MAP_SEND_ERROR, syserrno);
-    return bytes;
-}  /* pt_Send */
-
-static PRInt32 pt_SocketWrite(PRFileDesc *fd, const void *buf, PRInt32 amount)
-{
-    return pt_Send(fd, buf, amount, 0, PR_INTERVAL_NO_TIMEOUT);
-}  /* pt_SocketWrite */
-
-static PRStatus pt_GetSockName(PRFileDesc *fd, PRNetAddr *addr)
-{
-    PRIntn rv = -1;
-    pt_SockLen addr_len = sizeof(PRNetAddr);
-
-    if (pt_TestAbort()) return PR_FAILURE;
-
-    rv = getsockname(
-        fd->secret->md.osfd, (struct sockaddr*)addr, &addr_len);
-    if (rv == -1) {
-        pt_MapError(_PR_MD_MAP_GETSOCKNAME_ERROR, errno);
-        return PR_FAILURE;
-    } else {
-#ifdef _PR_HAVE_SOCKADDR_LEN
-        /* ignore the sa_len field of struct sockaddr */
-        if (addr)
-        {
-            addr->raw.family = ((struct sockaddr*)addr)->sa_family;
-        }
-#endif /* _PR_HAVE_SOCKADDR_LEN */
-
-        Assert(IsValidNetAddr(addr) == PR_TRUE);
-        Assert(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
-        return PR_SUCCESS;
-    }
-}  /* pt_GetSockName */
-
-static PRStatus pt_GetPeerName(PRFileDesc *fd, PRNetAddr *addr)
-{
-    PRIntn rv = -1;
-    pt_SockLen addr_len = sizeof(PRNetAddr);
-
-    if (pt_TestAbort()) return PR_FAILURE;
-
-    rv = getpeername(
-        fd->secret->md.osfd, (struct sockaddr*)addr, &addr_len);
-
-    if (rv == -1) {
-        pt_MapError(_PR_MD_MAP_GETPEERNAME_ERROR, errno);
-        return PR_FAILURE;
-    } else {
-#ifdef _PR_HAVE_SOCKADDR_LEN
-        /* ignore the sa_len field of struct sockaddr */
-        if (addr)
-        {
-            addr->raw.family = ((struct sockaddr*)addr)->sa_family;
-        }
-#endif /* _PR_HAVE_SOCKADDR_LEN */
-
-        Assert(IsValidNetAddr(addr) == PR_TRUE);
-        Assert(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
-        return PR_SUCCESS;
-    }
-}  /* pt_GetPeerName */
-
-static PRStatus pt_GetSocketOption(PRFileDesc *fd, PRSocketOptionData *data)
-{
-    PRIntn rv;
-    pt_SockLen length;
-    PRInt32 level, name;
-
-    /*
-     * PR_SockOpt_Nonblocking is a special case that does not
-     * translate to a getsockopt() call
-     */
-    if (PR_SockOpt_Nonblocking == data->option)
-    {
-        data->value.non_blocking = fd->secret->nonblocking;
-        return PR_SUCCESS;
-    }
-
-    rv = _PR_MapOptionName(data->option, &level, &name);
-    if (PR_SUCCESS == rv)
-    {
-        switch (data->option)
-        {
-            case PR_SockOpt_Linger:
-            {
-                struct linger linger;
-                length = sizeof(linger);
-                rv = getsockopt(
-                    fd->secret->md.osfd, level, name, (char *) &linger, &length);
-                Assert((-1 == rv) || (sizeof(linger) == length));
-                data->value.linger.polarity =
-                    (linger.l_onoff) ? PR_TRUE : PR_FALSE;
-                data->value.linger.linger =
-                    PR_SecondsToInterval(linger.l_linger);
-                break;
-            }
-            case PR_SockOpt_Reuseaddr:
-            case PR_SockOpt_Keepalive:
-            case PR_SockOpt_NoDelay:
-            case PR_SockOpt_Broadcast:
-            {
-                PRIntn value;
-                length = sizeof(PRIntn);
-                rv = getsockopt(
-                    fd->secret->md.osfd, level, name, (char*)&value, &length);
-                Assert((-1 == rv) || (sizeof(PRIntn) == length));
-                data->value.reuse_addr = (0 == value) ? PR_FALSE : PR_TRUE;
-                break;
-            }
-            case PR_SockOpt_McastLoopback:
-            {
-                PRUint8 xbool;
-                length = sizeof(xbool);
-                rv = getsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&xbool, &length);
-                Assert((-1 == rv) || (sizeof(xbool) == length));
-                data->value.mcast_loopback = (0 == xbool) ? PR_FALSE : PR_TRUE;
-                break;
-            }
-            case PR_SockOpt_RecvBufferSize:
-            case PR_SockOpt_SendBufferSize:
-            case PR_SockOpt_MaxSegment:
-            {
-                PRIntn value;
-                length = sizeof(PRIntn);
-                rv = getsockopt(
-                    fd->secret->md.osfd, level, name, (char*)&value, &length);
-                Assert((-1 == rv) || (sizeof(PRIntn) == length));
-                data->value.recv_buffer_size = value;
-                break;
-            }
-            case PR_SockOpt_IpTimeToLive:
-            case PR_SockOpt_IpTypeOfService:
-            {
-                length = sizeof(PRUintn);
-                rv = getsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&data->value.ip_ttl, &length);
-                Assert((-1 == rv) || (sizeof(PRIntn) == length));
-                break;
-            }
-            case PR_SockOpt_McastTimeToLive:
-            {
-                PRUint8 ttl;
-                length = sizeof(ttl);
-                rv = getsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&ttl, &length);
-                Assert((-1 == rv) || (sizeof(ttl) == length));
-                data->value.mcast_ttl = ttl;
-                break;
-            }
-            case PR_SockOpt_AddMember:
-            case PR_SockOpt_DropMember:
-            {
-                struct ip_mreq mreq;
-                length = sizeof(mreq);
-                rv = getsockopt(
-                    fd->secret->md.osfd, level, name, (char*)&mreq, &length);
-                Assert((-1 == rv) || (sizeof(mreq) == length));
-                data->value.add_member.mcaddr.inet.ip =
-                    mreq.imr_multiaddr.s_addr;
-                data->value.add_member.ifaddr.inet.ip =
-                    mreq.imr_interface.s_addr;
-                break;
-            }
-            case PR_SockOpt_McastInterface:
-            {
-                length = sizeof(data->value.mcast_if.inet.ip);
-                rv = getsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&data->value.mcast_if.inet.ip, &length);
-                Assert((-1 == rv)
-                    || (sizeof(data->value.mcast_if.inet.ip) == length));
-                break;
-            }
-            default:
-                break;
-        }
-        if (-1 == rv) _PR_MD_MAP_GETSOCKOPT_ERROR(errno);
-    }
-    return (-1 == rv) ? PR_FAILURE : PR_SUCCESS;
-}  /* pt_GetSocketOption */
-
-static PRStatus pt_SetSocketOption(PRFileDesc *fd, const PRSocketOptionData *data)
-{
-    PRIntn rv;
-    PRInt32 level, name;
-
-    /*
-     * PR_SockOpt_Nonblocking is a special case that does not
-     * translate to a setsockopt call.
-     */
-    if (PR_SockOpt_Nonblocking == data->option)
-    {
-        fd->secret->nonblocking = data->value.non_blocking;
-        return PR_SUCCESS;
-    }
-
-    rv = _PR_MapOptionName(data->option, &level, &name);
-    if (PR_SUCCESS == rv)
-    {
-        switch (data->option)
-        {
-            case PR_SockOpt_Linger:
-            {
-                struct linger linger;
-                linger.l_onoff = data->value.linger.polarity;
-                linger.l_linger = PR_IntervalToSeconds(data->value.linger.linger);
-                rv = setsockopt(
-                    fd->secret->md.osfd, level, name, (char*)&linger, sizeof(linger));
-                break;
-            }
-            case PR_SockOpt_Reuseaddr:
-            case PR_SockOpt_Keepalive:
-            case PR_SockOpt_NoDelay:
-            case PR_SockOpt_Broadcast:
-            {
-                PRIntn value = (data->value.reuse_addr) ? 1 : 0;
-                rv = setsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&value, sizeof(PRIntn));
-#ifdef LINUX
-                /* for pt_Linux1 */
-                if (name == TCP_NODELAY && rv == 0) {
-                    fd->secret->md.tcp_nodelay = value;
-                }
-#endif
-                break;
-            }
-            case PR_SockOpt_McastLoopback:
-            {
-                PRUint8 xbool = data->value.mcast_loopback ? 1 : 0;
-                rv = setsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&xbool, sizeof(xbool));
-                break;
-            }
-            case PR_SockOpt_RecvBufferSize:
-            case PR_SockOpt_SendBufferSize:
-            case PR_SockOpt_MaxSegment:
-            {
-                PRIntn value = data->value.recv_buffer_size;
-                rv = setsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&value, sizeof(PRIntn));
-                break;
-            }
-            case PR_SockOpt_IpTimeToLive:
-            case PR_SockOpt_IpTypeOfService:
-            {
-                rv = setsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&data->value.ip_ttl, sizeof(PRUintn));
-                break;
-            }
-            case PR_SockOpt_McastTimeToLive:
-            {
-                PRUint8 ttl = data->value.mcast_ttl;
-                rv = setsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&ttl, sizeof(ttl));
-                break;
-            }
-            case PR_SockOpt_AddMember:
-            case PR_SockOpt_DropMember:
-            {
-                struct ip_mreq mreq;
-                mreq.imr_multiaddr.s_addr =
-                    data->value.add_member.mcaddr.inet.ip;
-                mreq.imr_interface.s_addr =
-                    data->value.add_member.ifaddr.inet.ip;
-                rv = setsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&mreq, sizeof(mreq));
-                break;
-            }
-            case PR_SockOpt_McastInterface:
-            {
-                rv = setsockopt(
-                    fd->secret->md.osfd, level, name,
-                    (char*)&data->value.mcast_if.inet.ip,
-                    sizeof(data->value.mcast_if.inet.ip));
-                break;
-            }
-            default:
-                break;
-        }
-        if (-1 == rv) _PR_MD_MAP_SETSOCKOPT_ERROR(errno);
-    }
-    return (-1 == rv) ? PR_FAILURE : PR_SUCCESS;
-}  /* pt_SetSocketOption */
 
 /*****************************************************************************/
@@ -1746,147 +688,4 @@
 };
 
-static PRIOMethods _pr_pipe_methods = {
-    PR_DESC_PIPE,
-    pt_Close,
-    pt_Read,
-    pt_Write,
-    pt_Available_s,
-    pt_Synch,
-    (PRSeekFN)_PR_InvalidInt,
-    (PRSeek64FN)_PR_InvalidInt64,
-    (PRFileInfoFN)_PR_InvalidStatus,
-    (PRFileInfo64FN)_PR_InvalidStatus,
-    (PRWritevFN)_PR_InvalidInt,
-    (PRConnectFN)_PR_InvalidStatus,
-    (PRAcceptFN)_PR_InvalidDesc,
-    (PRBindFN)_PR_InvalidStatus,
-    (PRListenFN)_PR_InvalidStatus,
-    (PRShutdownFN)_PR_InvalidStatus,
-    (PRRecvFN)_PR_InvalidInt,
-    (PRSendFN)_PR_InvalidInt,
-    pt_Poll,
-    (PRGetsocknameFN)_PR_InvalidStatus,
-    (PRGetpeernameFN)_PR_InvalidStatus,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRGetsocketoptionFN)_PR_InvalidStatus,
-    (PRSetsocketoptionFN)_PR_InvalidStatus,
-    (PRConnectcontinueFN)_PR_InvalidStatus,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt
-};
-
-static PRIOMethods _pr_tcp_methods = {
-    PR_DESC_SOCKET_TCP,
-    pt_Close,
-    pt_SocketRead,
-    pt_SocketWrite,
-    pt_Available_s,
-    pt_Synch,
-    (PRSeekFN)_PR_InvalidInt,
-    (PRSeek64FN)_PR_InvalidInt64,
-    (PRFileInfoFN)_PR_InvalidStatus,
-    (PRFileInfo64FN)_PR_InvalidStatus,
-    pt_Writev,
-    pt_Connect,
-    pt_Accept,
-    pt_Bind,
-    pt_Listen,
-    pt_Shutdown,
-    pt_Recv,
-    pt_Send,
-    pt_Poll,
-    pt_GetSockName,
-    pt_GetPeerName,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt,
-    pt_GetSocketOption,
-    pt_SetSocketOption,
-    pt_ConnectContinue,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt
-};
-
-static PRIOMethods _pr_socketpollfd_methods = {
-    (PRDescType) 0,
-    (PRCloseFN)_PR_InvalidStatus,
-    (PRReadFN)_PR_InvalidInt,
-    (PRWriteFN)_PR_InvalidInt,
-    (PRAvailableFN)_PR_InvalidInt,
-    (PRFsyncFN)_PR_InvalidStatus,
-    (PRSeekFN)_PR_InvalidInt,
-    (PRSeek64FN)_PR_InvalidInt64,
-    (PRFileInfoFN)_PR_InvalidStatus,
-    (PRFileInfo64FN)_PR_InvalidStatus,
-    (PRWritevFN)_PR_InvalidInt,
-    (PRConnectFN)_PR_InvalidStatus,
-    (PRAcceptFN)_PR_InvalidDesc,
-    (PRBindFN)_PR_InvalidStatus,
-    (PRListenFN)_PR_InvalidStatus,
-    (PRShutdownFN)_PR_InvalidStatus,
-    (PRRecvFN)_PR_InvalidInt,
-    (PRSendFN)_PR_InvalidInt,
-	pt_Poll,
-    (PRGetsocknameFN)_PR_InvalidStatus,
-    (PRGetpeernameFN)_PR_InvalidStatus,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRGetsocketoptionFN)_PR_InvalidStatus,
-    (PRSetsocketoptionFN)_PR_InvalidStatus,
-    (PRConnectcontinueFN)_PR_InvalidStatus,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt,
-    (PRReservedFN)_PR_InvalidInt
-};
-
-#if defined(HPUX) || defined(OSF1) || defined(SOLARIS) || defined (IRIX) \
-    || defined(AIX) || defined(LINUX) || defined(FREEBSD) || defined(NETBSD) \
-    || defined(OPENBSD) || defined(BSDI) || defined(VMS) || defined(NTO) \
-    || defined(DARWIN) || defined(UNIXWARE)
-#define _PR_FCNTL_FLAGS O_NONBLOCK
-#else
-#error "Can't determine architecture"
-#endif
-
-/*
- * Put a Unix file descriptor in non-blocking mode.
- */
-static void pt_MakeFdNonblock(PRIntn osfd)
-{
-    PRIntn flags;
-    flags = fcntl(osfd, F_GETFL, 0);
-    flags |= _PR_FCNTL_FLAGS;
-    (void)fcntl(osfd, F_SETFL, flags);
-}
-
-/*
- * Put a Unix socket fd in non-blocking mode that can
- * ideally be inherited by an accepted socket.
- *
- * Why doesn't pt_MakeFdNonblock do?  This is to deal with
- * the special case of HP-UX.  HP-UX has three kinds of
- * non-blocking modes for sockets: the fcntl() O_NONBLOCK
- * and O_NDELAY flags and ioctl() FIOSNBIO request.  Only
- * the ioctl() FIOSNBIO form of non-blocking mode is
- * inherited by an accepted socket.
- *
- * Other platforms just use the generic pt_MakeFdNonblock
- * to put a socket in non-blocking mode.
- */
-#ifdef HPUX
-static void pt_MakeSocketNonblock(PRIntn osfd)
-{
-    PRIntn one = 1;
-    (void)ioctl(osfd, FIOSNBIO, &one);
-}
-#else
-#define pt_MakeSocketNonblock pt_MakeFdNonblock
-#endif
-
 static PRFileDesc *pt_SetMethods(
     PRIntn osfd, PRDescType type, PRBool isAcceptedSocket, PRBool imported)
@@ -1910,17 +709,5 @@
         {
             case PR_DESC_FILE:
-                fd->methods = PR_GetFileMethods();
-                break;
-            case PR_DESC_SOCKET_TCP:
-                fd->methods = PR_GetTCPMethods();
-#ifdef _PR_ACCEPT_INHERIT_NONBLOCK
-                if (!isAcceptedSocket) pt_MakeSocketNonblock(osfd);
-#else
-                pt_MakeSocketNonblock(osfd);
-#endif
-                break;
-            case PR_DESC_PIPE:
-                fd->methods = PR_GetPipeMethods();
-                pt_MakeFdNonblock(osfd);
+                fd->methods = &_pr_file_methods;
                 break;
             default:
@@ -1930,101 +717,4 @@
     return fd;
 }  /* pt_SetMethods */
-
-PR_IMPLEMENT(const PRIOMethods*) PR_GetFileMethods(void)
-{
-    return &_pr_file_methods;
-}  /* PR_GetFileMethods */
-
-PR_IMPLEMENT(const PRIOMethods*) PR_GetPipeMethods(void)
-{
-    return &_pr_pipe_methods;
-}  /* PR_GetPipeMethods */
-
-PR_IMPLEMENT(const PRIOMethods*) PR_GetTCPMethods(void)
-{
-    return &_pr_tcp_methods;
-}  /* PR_GetTCPMethods */
-
-static const PRIOMethods* PR_GetSocketPollFdMethods(void)
-{
-    return &_pr_socketpollfd_methods;
-}  /* PR_GetSocketPollFdMethods */
-
-PR_IMPLEMENT(PRFileDesc*) PR_AllocFileDesc(
-    PRInt32 osfd, const PRIOMethods *methods)
-{
-    PRFileDesc *fd = _PR_Getfd();
-
-    if (NULL == fd) goto failed;
-
-    fd->methods = methods;
-    fd->secret->md.osfd = osfd;
-    /* Make fd non-blocking */
-    if (osfd > 2)
-    {
-        /* Don't mess around with stdin, stdout or stderr */
-        if (&_pr_tcp_methods == methods) pt_MakeSocketNonblock(osfd);
-        else pt_MakeFdNonblock(osfd);
-    }
-    fd->secret->state = _PR_FILEDESC_OPEN;
-    fd->secret->inheritable = _PR_TRI_UNKNOWN;
-    return fd;
-
-failed:
-    PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
-    return fd;
-}  /* PR_AllocFileDesc */
-
-#ifdef VBOX
-PRUintn _PR_NetAddrSize(const PRNetAddr* addr)
-{
-    PRUintn addrsize;
-
-#if defined(XP_UNIX) || defined(XP_OS2_EMX)
-    if (AF_UNIX == addr->raw.family)
-        addrsize = sizeof(addr->local);
-#endif
-    else addrsize = 0;
-
-    return addrsize;
-}  /* _PR_NetAddrSize */
-#endif
-
-PR_IMPLEMENT(PRFileDesc*) PR_Socket(PRInt32 domain, PRInt32 type, PRInt32 proto)
-{
-    PRIntn osfd;
-    PRDescType ftype;
-    PRFileDesc *fd = NULL;
-	PRInt32 tmp_domain = domain;
-
-    if (!_pr_initialized) _PR_ImplicitInitialization();
-
-    if (pt_TestAbort()) return NULL;
-
-    if (PF_UNIX != domain)
-    {
-        PR_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR, 0);
-        return fd;
-    }
-	if (type == SOCK_STREAM) ftype = PR_DESC_SOCKET_TCP;
-	else if (type == SOCK_DGRAM) ftype = PR_DESC_SOCKET_UDP;
-	else
-	{
-		(void)PR_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR, 0);
-		return fd;
-	}
-
-    osfd = socket(domain, type, proto);
-    if (osfd == -1) pt_MapError(_PR_MD_MAP_SOCKET_ERROR, errno);
-    else
-    {
-        fd = pt_SetMethods(osfd, ftype, PR_FALSE, PR_FALSE);
-        if (fd == NULL) close(osfd);
-    }
-#ifdef _PR_STRICT_ADDR_LEN
-    if (fd != NULL) fd->secret->af = domain;
-#endif
-    return fd;
-}  /* PR_Socket */
 
 /*****************************************************************************/
@@ -2092,27 +782,4 @@
 }  /* PR_Open */
 
-PR_IMPLEMENT(PRStatus) PR_Delete(const char *name)
-{
-    PRIntn rv = -1;
-
-    if (!_pr_initialized) _PR_ImplicitInitialization();
-
-    if (pt_TestAbort()) return PR_FAILURE;
-
-    rv = unlink(name);
-
-    if (rv == -1) {
-        pt_MapError(_PR_MD_MAP_UNLINK_ERROR, errno);
-        return PR_FAILURE;
-    } else
-        return PR_SUCCESS;
-}  /* PR_Delete */
-
-PR_IMPLEMENT(PRStatus) PR_GetFileInfo(const char *fn, PRFileInfo *info)
-{
-    PRInt32 rv = _PR_MD_GETFILEINFO(fn, info);
-    return (0 == rv) ? PR_SUCCESS : PR_FAILURE;
-}  /* PR_GetFileInfo */
-
 PR_IMPLEMENT(PRStatus) PR_GetFileInfo64(const char *fn, PRFileInfo64 *info)
 {
@@ -2124,442 +791,3 @@
 }  /* PR_GetFileInfo64 */
 
-static PRInt32 _pr_poll_with_poll(
-    PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout)
-{
-    PRInt32 ready = 0;
-    /*
-     * For restarting poll() if it is interrupted by a signal.
-     * We use these variables to figure out how much time has
-     * elapsed and how much of the timeout still remains.
-     */
-    PRIntervalTime start, elapsed, remaining;
-
-    if (pt_TestAbort()) return -1;
-
-    if (0 == npds) RTThreadSleep(PR_IntervalToMilliseconds(timeout));
-    else
-    {
-#define STACK_POLL_DESC_COUNT 64
-        struct pollfd stack_syspoll[STACK_POLL_DESC_COUNT];
-        struct pollfd *syspoll;
-        PRIntn index, msecs;
-
-        if (npds <= STACK_POLL_DESC_COUNT)
-        {
-            syspoll = stack_syspoll;
-        }
-        else
-        {
-            PRThread *me = PR_GetCurrentThread();
-            if (npds > me->syspoll_count)
-            {
-                PR_Free(me->syspoll_list);
-                me->syspoll_list =
-                    (struct pollfd*)PR_MALLOC(npds * sizeof(struct pollfd));
-                if (NULL == me->syspoll_list)
-                {
-                    me->syspoll_count = 0;
-                    PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
-                    return -1;
-                }
-                me->syspoll_count = npds;
-            }
-            syspoll = me->syspoll_list;
-        }
-
-        for (index = 0; index < npds; ++index)
-        {
-            PRInt16 in_flags_read = 0, in_flags_write = 0;
-            PRInt16 out_flags_read = 0, out_flags_write = 0;
-
-            if ((NULL != pds[index].fd) && (0 != pds[index].in_flags))
-            {
-                if (pds[index].in_flags & PR_POLL_READ)
-                {
-                    in_flags_read = (pds[index].fd->methods->poll)(
-                        pds[index].fd,
-                        pds[index].in_flags & ~PR_POLL_WRITE,
-                        &out_flags_read);
-                }
-                if (pds[index].in_flags & PR_POLL_WRITE)
-                {
-                    in_flags_write = (pds[index].fd->methods->poll)(
-                        pds[index].fd,
-                        pds[index].in_flags & ~PR_POLL_READ,
-                        &out_flags_write);
-                }
-                if ((0 != (in_flags_read & out_flags_read))
-                || (0 != (in_flags_write & out_flags_write)))
-                {
-                    /* this one is ready right now */
-                    if (0 == ready)
-                    {
-                        /*
-                         * We will return without calling the system
-                         * poll function.  So zero the out_flags
-                         * fields of all the poll descriptors before
-                         * this one.
-                         */
-                        int i;
-                        for (i = 0; i < index; i++)
-                        {
-                            pds[i].out_flags = 0;
-                        }
-                    }
-                    ready += 1;
-                    pds[index].out_flags = out_flags_read | out_flags_write;
-                }
-                else
-                {
-                    /* now locate the NSPR layer at the bottom of the stack */
-                    PRFileDesc *bottom = PR_GetIdentitiesLayer(
-                        pds[index].fd, PR_NSPR_IO_LAYER);
-                    Assert(NULL != bottom);  /* what to do about that? */
-                    pds[index].out_flags = 0;  /* pre-condition */
-                    if ((NULL != bottom)
-                    && (_PR_FILEDESC_OPEN == bottom->secret->state))
-                    {
-                        if (0 == ready)
-                        {
-                            syspoll[index].fd = bottom->secret->md.osfd;
-                            syspoll[index].events = 0;
-                            if (in_flags_read & PR_POLL_READ)
-                            {
-                                pds[index].out_flags |=
-                                    _PR_POLL_READ_SYS_READ;
-                                syspoll[index].events |= POLLIN;
-                            }
-                            if (in_flags_read & PR_POLL_WRITE)
-                            {
-                                pds[index].out_flags |=
-                                    _PR_POLL_READ_SYS_WRITE;
-                                syspoll[index].events |= POLLOUT;
-                            }
-                            if (in_flags_write & PR_POLL_READ)
-                            {
-                                pds[index].out_flags |=
-                                    _PR_POLL_WRITE_SYS_READ;
-                                syspoll[index].events |= POLLIN;
-                            }
-                            if (in_flags_write & PR_POLL_WRITE)
-                            {
-                                pds[index].out_flags |=
-                                    _PR_POLL_WRITE_SYS_WRITE;
-                                syspoll[index].events |= POLLOUT;
-                            }
-                            if (pds[index].in_flags & PR_POLL_EXCEPT)
-                                syspoll[index].events |= POLLPRI;
-                        }
-                    }
-                    else
-                    {
-                        if (0 == ready)
-                        {
-                            int i;
-                            for (i = 0; i < index; i++)
-                            {
-                                pds[i].out_flags = 0;
-                            }
-                        }
-                        ready += 1;  /* this will cause an abrupt return */
-                        pds[index].out_flags = PR_POLL_NVAL;  /* bogii */
-                    }
-                }
-            }
-            else
-            {
-                /* make poll() ignore this entry */
-                syspoll[index].fd = -1;
-                syspoll[index].events = 0;
-                pds[index].out_flags = 0;
-            }
-        }
-        if (0 == ready)
-        {
-            switch (timeout)
-            {
-            case PR_INTERVAL_NO_WAIT: msecs = 0; break;
-            case PR_INTERVAL_NO_TIMEOUT: msecs = -1; break;
-            default:
-                msecs = PR_IntervalToMilliseconds(timeout);
-                start = PR_IntervalNow();
-            }
-
-retry:
-            ready = poll(syspoll, npds, msecs);
-            if (-1 == ready)
-            {
-                PRIntn oserror = errno;
-
-                if (EINTR == oserror)
-                {
-                    if (timeout == PR_INTERVAL_NO_TIMEOUT)
-                        goto retry;
-                    else if (timeout == PR_INTERVAL_NO_WAIT)
-                        ready = 0;  /* don't retry, just time out */
-                    else
-                    {
-                        elapsed = (PRIntervalTime) (PR_IntervalNow()
-                                - start);
-                        if (elapsed > timeout)
-                            ready = 0;  /* timed out */
-                        else
-                        {
-                            remaining = timeout - elapsed;
-                            msecs = PR_IntervalToMilliseconds(remaining);
-                            goto retry;
-                        }
-                    }
-                }
-                else
-                {
-                    _PR_MD_MAP_POLL_ERROR(oserror);
-                }
-            }
-            else if (ready > 0)
-            {
-                for (index = 0; index < npds; ++index)
-                {
-                    PRInt16 out_flags = 0;
-                    if ((NULL != pds[index].fd) && (0 != pds[index].in_flags))
-                    {
-                        if (0 != syspoll[index].revents)
-                        {
-                            if (syspoll[index].revents & POLLIN)
-                            {
-                                if (pds[index].out_flags
-                                & _PR_POLL_READ_SYS_READ)
-                                {
-                                    out_flags |= PR_POLL_READ;
-                                }
-                                if (pds[index].out_flags
-                                & _PR_POLL_WRITE_SYS_READ)
-                                {
-                                    out_flags |= PR_POLL_WRITE;
-                                }
-                            }
-                            if (syspoll[index].revents & POLLOUT)
-                            {
-                                if (pds[index].out_flags
-                                & _PR_POLL_READ_SYS_WRITE)
-                                {
-                                    out_flags |= PR_POLL_READ;
-                                }
-                                if (pds[index].out_flags
-                                & _PR_POLL_WRITE_SYS_WRITE)
-                                {
-                                    out_flags |= PR_POLL_WRITE;
-                                }
-                            }
-                            if (syspoll[index].revents & POLLPRI)
-                                out_flags |= PR_POLL_EXCEPT;
-                            if (syspoll[index].revents & POLLERR)
-                                out_flags |= PR_POLL_ERR;
-                            if (syspoll[index].revents & POLLNVAL)
-                                out_flags |= PR_POLL_NVAL;
-                            if (syspoll[index].revents & POLLHUP)
-                                out_flags |= PR_POLL_HUP;
-                        }
-                    }
-                    pds[index].out_flags = out_flags;
-                }
-            }
-        }
-    }
-    return ready;
-
-} /* _pr_poll_with_poll */
-
-PR_IMPLEMENT(PRInt32) PR_Poll(
-    PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout)
-{
-	return(_pr_poll_with_poll(pds, npds, timeout));
-}
-
-PR_IMPLEMENT(PRFileDesc*) PR_OpenTCPSocket(PRIntn af)
-{
-    return PR_Socket(af, SOCK_STREAM, 0);
-}  /* PR_NewTCPSocket */
-
-PR_IMPLEMENT(PRStatus) PR_CreatePipe(
-    PRFileDesc **readPipe,
-    PRFileDesc **writePipe
-)
-{
-    int pipefd[2];
-
-    if (pt_TestAbort()) return PR_FAILURE;
-
-    if (pipe(pipefd) == -1)
-    {
-    /* XXX map pipe error */
-        PR_SetError(PR_UNKNOWN_ERROR, errno);
-        return PR_FAILURE;
-    }
-    fcntl(pipefd[0], F_SETFD, FD_CLOEXEC);
-    fcntl(pipefd[1], F_SETFD, FD_CLOEXEC);
-    *readPipe = pt_SetMethods(pipefd[0], PR_DESC_PIPE, PR_FALSE, PR_FALSE);
-    if (NULL == *readPipe)
-    {
-        close(pipefd[0]);
-        close(pipefd[1]);
-        return PR_FAILURE;
-    }
-    *writePipe = pt_SetMethods(pipefd[1], PR_DESC_PIPE, PR_FALSE, PR_FALSE);
-    if (NULL == *writePipe)
-    {
-        PR_Close(*readPipe);
-        close(pipefd[1]);
-        return PR_FAILURE;
-    }
-    return PR_SUCCESS;
-}
-
-/*
-** Set the inheritance attribute of a file descriptor.
-*/
-PR_IMPLEMENT(PRStatus) PR_SetFDInheritable(
-    PRFileDesc *fd,
-    PRBool inheritable)
-{
-    /*
-     * Only a non-layered, NSPR file descriptor can be inherited
-     * by a child process.
-     */
-    if (fd->identity != PR_NSPR_IO_LAYER)
-    {
-        PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
-        return PR_FAILURE;
-    }
-    if (fd->secret->inheritable != inheritable)
-    {
-        if (fcntl(fd->secret->md.osfd, F_SETFD,
-        inheritable ? 0 : FD_CLOEXEC) == -1)
-        {
-            return PR_FAILURE;
-        }
-        fd->secret->inheritable = (_PRTriStateBool) inheritable;
-    }
-    return PR_SUCCESS;
-}
-
-/*****************************************************************************/
-/***************************** I/O friends methods ***************************/
-/*****************************************************************************/
-
-PR_IMPLEMENT(PRFileDesc*) PR_ImportFile(PRInt32 osfd)
-{
-    PRFileDesc *fd;
-
-    if (!_pr_initialized) _PR_ImplicitInitialization();
-    fd = pt_SetMethods(osfd, PR_DESC_FILE, PR_FALSE, PR_TRUE);
-    if (NULL == fd) close(osfd);
-    return fd;
-}  /* PR_ImportFile */
-
-PR_IMPLEMENT(PRFileDesc*) PR_ImportPipe(PRInt32 osfd)
-{
-    PRFileDesc *fd;
-
-    if (!_pr_initialized) _PR_ImplicitInitialization();
-    fd = pt_SetMethods(osfd, PR_DESC_PIPE, PR_FALSE, PR_TRUE);
-    if (NULL == fd) close(osfd);
-    return fd;
-}  /* PR_ImportPipe */
-
-PR_IMPLEMENT(PRFileDesc*) PR_ImportTCPSocket(PRInt32 osfd)
-{
-    PRFileDesc *fd;
-
-    if (!_pr_initialized) _PR_ImplicitInitialization();
-    fd = pt_SetMethods(osfd, PR_DESC_SOCKET_TCP, PR_FALSE, PR_TRUE);
-    if (NULL == fd) close(osfd);
-#ifdef _PR_STRICT_ADDR_LEN
-    if (NULL != fd) fd->secret->af = PF_INET;
-#endif
-    return fd;
-}  /* PR_ImportTCPSocket */
-
-PR_IMPLEMENT(PRFileDesc*) PR_ImportUDPSocket(PRInt32 osfd)
-{
-    PRFileDesc *fd;
-
-    if (!_pr_initialized) _PR_ImplicitInitialization();
-    fd = pt_SetMethods(osfd, PR_DESC_SOCKET_UDP, PR_FALSE, PR_TRUE);
-    if (NULL != fd) close(osfd);
-    return fd;
-}  /* PR_ImportUDPSocket */
-
-PR_IMPLEMENT(PRFileDesc*) PR_CreateSocketPollFd(PRInt32 osfd)
-{
-    PRFileDesc *fd;
-
-    if (!_pr_initialized) _PR_ImplicitInitialization();
-
-    fd = _PR_Getfd();
-
-    if (fd == NULL) PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
-    else
-    {
-        fd->secret->md.osfd = osfd;
-        fd->secret->inheritable = _PR_TRI_FALSE;
-    	fd->secret->state = _PR_FILEDESC_OPEN;
-        fd->methods = PR_GetSocketPollFdMethods();
-    }
-
-    return fd;
-}  /* PR_CreateSocketPollFD */
-
-PR_IMPLEMENT(PRStatus) PR_DestroySocketPollFd(PRFileDesc *fd)
-{
-    if (NULL == fd)
-    {
-        PR_SetError(PR_BAD_DESCRIPTOR_ERROR, 0);
-        return PR_FAILURE;
-    }
-    fd->secret->state = _PR_FILEDESC_CLOSED;
-    _PR_Putfd(fd);
-    return PR_SUCCESS;
-}  /* PR_DestroySocketPollFd */
-
-#ifdef VBOX
-PR_IMPLEMENT(PRFileDesc*) PR_GetIdentitiesLayer(PRFileDesc* fd, PRDescIdentity id)
-{
-    PRFileDesc *layer = fd;
-
-    if (PR_TOP_IO_LAYER == id) {
-    	if (PR_IO_LAYER_HEAD == fd->identity)
-			return fd->lower;
-		else 
-			return fd;
-	}
-
-    for (layer = fd; layer != NULL; layer = layer->lower)
-    {
-        if (id == layer->identity) return layer;
-    }
-    for (layer = fd; layer != NULL; layer = layer->higher)
-    {
-        if (id == layer->identity) return layer;
-    }
-    return NULL;
-}  /* PR_GetIdentitiesLayer */
-#endif
-
-PR_IMPLEMENT(PRInt32) PR_FileDesc2NativeHandle(PRFileDesc *bottom)
-{
-    PRInt32 osfd = -1;
-    bottom = (NULL == bottom) ?
-        NULL : PR_GetIdentitiesLayer(bottom, PR_NSPR_IO_LAYER);
-    if (NULL == bottom) PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
-    else osfd = bottom->secret->md.osfd;
-    return osfd;
-}  /* PR_FileDesc2NativeHandle */
-
-PR_IMPLEMENT(void) PR_ChangeFileDescNativeHandle(PRFileDesc *fd,
-    PRInt32 handle)
-{
-    if (fd) fd->secret->md.osfd = handle;
-}  /*  PR_ChangeFileDescNativeHandle*/
-
 /* ptio.c */
