Source file src/syscall/types_aix.go

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build ignore
     6  
     7  /*
     8  Input to cgo -godefs.  See also mkerrors.sh and mkall.sh
     9  */
    10  
    11  // +godefs map struct_in_addr [4]byte /* in_addr */
    12  // +godefs map struct_in6_addr [16]byte /* in6_addr */
    13  
    14  package syscall
    15  
    16  /*
    17  #include <sys/types.h>
    18  #include <sys/time.h>
    19  #include <sys/limits.h>
    20  #include <sys/un.h>
    21  #include <sys/utsname.h>
    22  #include <sys/ptrace.h>
    23  #include <sys/statfs.h>
    24  
    25  #include <net/if.h>
    26  #include <net/if_dl.h>
    27  #include <netinet/in.h>
    28  #include <netinet/icmp6.h>
    29  
    30  #include <termios.h>
    31  
    32  #include <dirent.h>
    33  #include <fcntl.h>
    34  #include <gcrypt.h>
    35  
    36  enum {
    37  	sizeofPtr = sizeof(void*),
    38  };
    39  
    40  union sockaddr_all {
    41  	struct sockaddr s1;	// this one gets used for fields
    42  	struct sockaddr_in s2;	// these pad it out
    43  	struct sockaddr_in6 s3;
    44  	struct sockaddr_un s4;
    45  };
    46  
    47  struct sockaddr_any {
    48  	struct sockaddr addr;
    49  	char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
    50  };
    51  
    52  */
    53  import "C"
    54  
    55  // Machine characteristics; for internal use.
    56  
    57  const (
    58  	sizeofPtr      = C.sizeofPtr
    59  	sizeofShort    = C.sizeof_short
    60  	sizeofInt      = C.sizeof_int
    61  	sizeofLong     = C.sizeof_long
    62  	sizeofLongLong = C.sizeof_longlong
    63  	PathMax        = C.PATH_MAX
    64  )
    65  
    66  // Basic types
    67  
    68  type (
    69  	_C_short     C.short
    70  	_C_int       C.int
    71  	_C_long      C.long
    72  	_C_long_long C.longlong
    73  )
    74  
    75  // Time
    76  
    77  type Timespec C.struct_timespec
    78  
    79  type Timeval C.struct_timeval
    80  
    81  type Timeval32 C.struct_timeval32
    82  
    83  type Timezone C.struct_timezone
    84  
    85  // Processes
    86  
    87  type Rusage C.struct_rusage
    88  
    89  type Rlimit C.struct_rlimit
    90  
    91  type _Pid_t C.pid_t
    92  
    93  type _Gid_t C.gid_t
    94  
    95  // Files
    96  
    97  type Flock_t C.struct_flock
    98  
    99  type Stat_t C.struct_stat
   100  
   101  type Statfs_t C.struct_statfs
   102  
   103  type Fsid64_t C.fsid64_t
   104  
   105  type StTimespec_t C.st_timespec_t
   106  
   107  type Dirent C.struct_dirent
   108  
   109  // Sockets
   110  
   111  type RawSockaddrInet4 C.struct_sockaddr_in
   112  
   113  type RawSockaddrInet6 C.struct_sockaddr_in6
   114  
   115  type RawSockaddrUnix C.struct_sockaddr_un
   116  
   117  type RawSockaddrDatalink C.struct_sockaddr_dl
   118  
   119  type RawSockaddr C.struct_sockaddr
   120  
   121  type RawSockaddrAny C.struct_sockaddr_any
   122  
   123  type _Socklen C.socklen_t
   124  
   125  type Cmsghdr C.struct_cmsghdr
   126  
   127  type ICMPv6Filter C.struct_icmp6_filter
   128  
   129  type Iovec C.struct_iovec
   130  
   131  type IPMreq C.struct_ip_mreq
   132  
   133  type IPv6Mreq C.struct_ipv6_mreq
   134  
   135  type Linger C.struct_linger
   136  
   137  type Msghdr C.struct_msghdr
   138  
   139  const (
   140  	SizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in
   141  	SizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6
   142  	SizeofSockaddrAny      = C.sizeof_struct_sockaddr_any
   143  	SizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un
   144  	SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
   145  	SizeofLinger           = C.sizeof_struct_linger
   146  	SizeofIPMreq           = C.sizeof_struct_ip_mreq
   147  	SizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq
   148  	SizeofMsghdr           = C.sizeof_struct_msghdr
   149  	SizeofCmsghdr          = C.sizeof_struct_cmsghdr
   150  	SizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter
   151  )
   152  
   153  // Ptrace requests
   154  
   155  const (
   156  	PTRACE_TRACEME = C.PT_TRACE_ME
   157  	PTRACE_CONT    = C.PT_CONTINUE
   158  	PTRACE_KILL    = C.PT_KILL
   159  )
   160  
   161  // Routing and interface messages
   162  
   163  const (
   164  	SizeofIfMsghdr = C.sizeof_struct_if_msghdr
   165  )
   166  
   167  type IfMsgHdr C.struct_if_msghdr
   168  
   169  // Misc
   170  
   171  type Utsname C.struct_utsname
   172  
   173  const (
   174  	_AT_FDCWD            = C.AT_FDCWD
   175  	_AT_REMOVEDIR        = C.AT_REMOVEDIR
   176  	_AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
   177  )
   178  
   179  // Terminal handling
   180  
   181  type Termios C.struct_termios
   182  

View as plain text