HPlogo Berkeley Sockets/iX Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 File System Intrinsics

DUP

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

C Interface

        int dup (s)

        int s;

Description

This function returns a socket descriptor that refers to the same socket as specified by s. Both descriptors can be used to reference the socket. The new socket descriptor is the lowest numbered available socket descriptor.

For more information about dup or any other POSIX function, refer to the MPE/iX Developer's Kit Reference Manual, Volume 1.

Return Value

If the call is successful, a valid file descriptor referencing the socket is returned. If it fails a -1 is returned, and an error code is stored in errno.

Errors

[ENOTSOCK]

The argument s is not a valid socket descriptor.

[ENOMEM]

The process has no more descriptors available.

See Also

socket

Feedback to webmaster