~ubuntu-branches/ubuntu/lucid/mpop/lucid

« back to all changes in this revision

Viewing changes to gnulib/sys_socket.in.h

  • Committer: Bazaar Package Importer
  • Author(s): Emmanuel Bouthenot
  • Date: 2009-10-28 05:38:15 UTC
  • mfrom: (1.1.6 upstream) (3.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091028053815-0zun1ngjl87jckx6
Tags: 1.0.19-1
* New upstream release
* Remove the patch about hyphens in manpage (merged upstream).

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#ifndef _GL_SYS_SOCKET_H
44
44
#define _GL_SYS_SOCKET_H
45
45
 
 
46
#if !@HAVE_SA_FAMILY_T@
 
47
typedef unsigned short  sa_family_t;
 
48
#endif
 
49
 
 
50
#if !@HAVE_STRUCT_SOCKADDR_STORAGE@
 
51
# include <alignof.h>
 
52
/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
 
53
   2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
 
54
# define __ss_aligntype unsigned long int
 
55
# define _SS_SIZE 256
 
56
# define _SS_PADSIZE \
 
57
    (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype)      \
 
58
                  ? sizeof (sa_family_t)                                \
 
59
                  : alignof (__ss_aligntype))                           \
 
60
                 + sizeof (__ss_aligntype)))
 
61
 
 
62
struct sockaddr_storage
 
63
{
 
64
  sa_family_t ss_family;      /* Address family, etc.  */
 
65
  __ss_aligntype __ss_align;  /* Force desired alignment.  */
 
66
  char __ss_padding[_SS_PADSIZE];
 
67
};
 
68
#endif
 
69
 
46
70
#if @HAVE_SYS_SOCKET_H@
47
71
 
48
72
/* A platform that has <sys/socket.h>.  */
399
423
 
400
424
#endif /* HAVE_SYS_SOCKET_H */
401
425
 
 
426
#ifdef __cplusplus
 
427
extern "C" {
 
428
#endif
 
429
 
 
430
#if @GNULIB_ACCEPT4@
 
431
/* Accept a connection on a socket, with specific opening flags.
 
432
   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
 
433
   and O_TEXT, O_BINARY (defined in "binary-io.h").
 
434
   See also the Linux man page at
 
435
   <http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>.  */
 
436
# if @HAVE_ACCEPT4@
 
437
#  define accept4 rpl_accept4
 
438
# endif
 
439
extern int accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
 
440
                    int flags);
 
441
#elif defined GNULIB_POSIXCHECK
 
442
# undef accept4
 
443
# define accept4(s,a,l,f) \
 
444
    (GL_LINK_WARNING ("accept4 is unportable - " \
 
445
                      "use gnulib module accept4 for portability"), \
 
446
     accept4 (s, a, l, f))
 
447
#endif
 
448
 
 
449
#ifdef __cplusplus
 
450
}
 
451
#endif
 
452
 
402
453
#endif /* _GL_SYS_SOCKET_H */
403
454
#endif /* _GL_SYS_SOCKET_H */