home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue6 / SDL.ZIP / !gcc / include / unixlib / sys / h / un < prev    next >
Encoding:
Text File  |  2006-09-17  |  1.7 KB  |  58 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: $
  4.  * $Date: $
  5.  * $Revision: $
  6.  * $State: $
  7.  * $Author: $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. /* Copyright (C) 1991, 1995, 1996, 2001 Free Software Foundation, Inc.
  12.    This file is part of the GNU C Library.
  13.  
  14.    The GNU C Library is free software; you can redistribute it and/or
  15.    modify it under the terms of the GNU Lesser General Public
  16.    License as published by the Free Software Foundation; either
  17.    version 2.1 of the License, or (at your option) any later version.
  18.  
  19.    The GNU C Library is distributed in the hope that it will be useful,
  20.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  22.    Lesser General Public License for more details.
  23.  
  24.    You should have received a copy of the GNU Lesser General Public
  25.    License along with the GNU C Library; if not, write to the Free
  26.    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  27.    02111-1307 USA.  */
  28.  
  29. #ifndef    _SYS_UN_H
  30. #define    _SYS_UN_H    1
  31.  
  32. #include <sys/cdefs.h>
  33.  
  34. /* Get the definition of the macro to define the common sockaddr members.  */
  35. #include <bits/sockaddr.h>
  36.  
  37. __BEGIN_DECLS
  38.  
  39. /* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket.  */
  40. struct sockaddr_un
  41.   {
  42.     __SOCKADDR_COMMON (sun_);
  43.     char sun_path[108];        /* Path name.  */
  44.   };
  45.  
  46.  
  47. #ifdef __USE_MISC
  48. # include <string.h>        /* For prototype of `strlen'.  */
  49.  
  50. /* Evaluate to actual length of the `sockaddr_un' structure.  */
  51. # define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path)          \
  52.               + strlen ((ptr)->sun_path))
  53. #endif
  54.  
  55. __END_DECLS
  56.  
  57. #endif    /* sys/un.h  */
  58.