The UNIX Operating System

TOP

UP


Ray Seyfarth

ORCA


Computer Science

COST

USM




Socket Descriptors


  • UNIX open yields a file descriptor:
    a small integer used to read/write a file

  • UNIX keeps a file descriptor table for each process
    an array of pointers to data about open files

  • A file descriptor is used to index the array

  • Sockets are added to this abstraction

  • The socket system call returns a socket descriptor

  • Files and sockets are accessed using the same table

  • The structure pointed to by a table entry has a field which tells whether it is a file or socket.


University of Southern Mississippi
Ray.Seyfarth@usm.edu
Updated 20:05 Jun 5, 2000