TABLE OF CONTENTS

socket/accept
socket/access
socket/basename
socket/bind
socket/bindresvport
socket/close
socket/read
socket/socket
socket/write
socket/accept                                                   socket/accept

   NAME
        accept -- accept new connection from socket

   SYNOPSIS
        ns = accept( s, name, len)

        int accept (int, struct sockaddr *, int *); 

   FUNCTION
        After a server executes the listen() call, a connection from 
        some client process is waited for by having the server execute
        the accept() call.  

    INPUTS
        s        socket descriptor

        name    pointer to the sockaddr struct that is returned

        len        pointer to the length of the sockaddr struct
                the value returned will be the actual size of the
                sockaddr struct that was returned


   RESULT
        ns        new socket descriptor or -1 on error

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO

socket/access                                                   socket/access

   NAME
        access -- Check the accessibility of a file

   SYNOPSIS
        return = access( filename, mode)

        int access (char *, int); 

   FUNCTION
        Checks to see if a file can be accessed with a certain mode.
        Returns true (0) if mode is write and file is not found.

    INPUTS
        filename    name of the file

        mode        file mode

   RESULT
        0 is returned if successful.  -1 is returned on error.

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO

socket/basename                                               socket/basename

   NAME
        basename -- get the filename from the pathname

   SYNOPSIS
        name = basename( pathname )

        char *basename (char *); 

   FUNCTION
        Returns pointer to basename in the input string.

    INPUTS
        pathname    string containing pathname of file.

   RESULT
        name        pointer to basename in string

   EXAMPLE
        name = basename("dh0:graphics/pics/car.iff");
        name points to "car.iff"

   NOTES

   BUGS

   SEE ALSO

socket/bind                                                       socket/bind

   NAME
        bind -- bind a name to a socket

   SYNOPSIS
        return = bind (s, name, namelen)

        int bind (int, struct sockaddr *, int); 

   FUNCTION
        bind() assigns a name to an unnamed socket

    INPUTS
        s            
        name
        namelen

   RESULT
        0 is returned if successful.  -1 is returned on error.
        errno will contain the specific error.

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO

socket/bindresvport                                       socket/bindresvport

   NAME
        bindresvport -- Bind a socket to a privileged IP port

   SYNOPSIS
        return = bindresvport ( sd, sin )

        int bindresvport ( int, struct sockaddr_in *);

   FUNCTION
        bindresvport is used to bind a socket descriptor to a 
        priveleged IP port (in the range 0-1023).
        

    INPUTS
        sd    

        sin

   RESULT
        0 is returned if successful.  -1 is returned on error.
        errno will be set to the specific error code.

   EXAMPLE

   NOTES
        rresvport() is equivalent to bindresvport() except that
        rresvport() only works for TCP sockets.

   BUGS

   SEE ALSO

socket/close                                                     socket/close

   NAME
        close -- close a file

   SYNOPSIS
        status = close ( unit );

        int  = close ( int ); 

   FUNCTION
        This function closes a file.

    INPUTS
        unit        unit number

   RESULT
        status        = 0 if successful
                    = -1 if error occurred

   EXAMPLE

   NOTES
        This replaces the normal compiler close() function.

   BUGS

   SEE ALSO
        read(), write()

socket/read                                                       socket/read

   NAME
        read -- read a file

   SYNOPSIS
        status = read ( unit, buffer, length);

        int  = read ( int, char *, int); 

   FUNCTION
        This function reads the next set of bytes from a file
        that has been activated via a previous open call.

    INPUTS
        unit        unit number
        buffer        input buffer
        length        buffer length in bytes

   RESULT
        status        = number of bytes actually read
                    = 0 if end of file
                    = -1 if error occurred

   EXAMPLE

   NOTES
        This replaces the normal compiler read() function.

   BUGS

   SEE ALSO
        write(), close()

socket/socket                                                   socket/socket

    NAME
        socket - create an endpoint for communication.

    SYNOPSIS
        s = socket( family, type, protocol )

        int socket( int, int, int )

    FUNCTION
        socket() returns a small integer representing a socket
        descriptor. 


    INPUTS
        family   - This specifies an address format with which
                   addresses specified in later operations using
                   socket should be interpreted.
        type     - Specifies the semantice of communication.
        protocol - Specifies a particular protocol to be used with the
                   socket.

    RESULT
        s        - Returns a (-1) upon failure ; a socket descriptor
                   upon success. 

   
socket/write                                                     socket/write

   NAME
        write -- write to a file

   SYNOPSIS
        status = write ( unit, buffer, length);

        int  = write ( int, char *, int); 

   FUNCTION
        This function writes a set of bytes to the current file
        position.

    INPUTS
        unit        unit number
        buffer        output buffer
        length        buffer length in bytes

   RESULT
        status        = number of bytes actually written
                    = -1 if error occurred

   EXAMPLE

   NOTES
        This replaces the normal compiler write() function.

   BUGS

   SEE ALSO
        read(), close()

