Skip to content

Commit

Permalink
syscall: regenerate z-files for darwin
Browse files Browse the repository at this point in the history
Updates z-files from 10.7 kernel-based to 10.9 kernel-based.

LGTM=iant
R=golang-codereviews, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/102610045
  • Loading branch information
cixtor committed Jun 24, 2014
1 parent 88b663b commit fbd5ad5
Show file tree
Hide file tree
Showing 8 changed files with 464 additions and 15 deletions.
24 changes: 24 additions & 0 deletions api/except.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,27 @@ pkg syscall (netbsd-arm), const SizeofIfData = 132
pkg syscall (netbsd-arm), type IfMsghdr struct, Pad_cgo_1 [4]uint8
pkg syscall (netbsd-arm-cgo), const SizeofIfData = 132
pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Pad_cgo_1 [4]uint8
pkg syscall (darwin-386), const AF_MAX = 38
pkg syscall (darwin-386), const ELAST = 105
pkg syscall (darwin-386), const EVFILT_SYSCOUNT = 12
pkg syscall (darwin-386), const EVFILT_THREADMARKER = 12
pkg syscall (darwin-386), const IPV6_FRAGTTL = 120
pkg syscall (darwin-386), const SYS_MAXSYSCALL = 439
pkg syscall (darwin-386-cgo), const AF_MAX = 38
pkg syscall (darwin-386-cgo), const ELAST = 105
pkg syscall (darwin-386-cgo), const EVFILT_SYSCOUNT = 12
pkg syscall (darwin-386-cgo), const EVFILT_THREADMARKER = 12
pkg syscall (darwin-386-cgo), const IPV6_FRAGTTL = 120
pkg syscall (darwin-386-cgo), const SYS_MAXSYSCALL = 439
pkg syscall (darwin-amd64), const AF_MAX = 38
pkg syscall (darwin-amd64), const ELAST = 105
pkg syscall (darwin-amd64), const EVFILT_SYSCOUNT = 12
pkg syscall (darwin-amd64), const EVFILT_THREADMARKER = 12
pkg syscall (darwin-amd64), const IPV6_FRAGTTL = 120
pkg syscall (darwin-amd64), const SYS_MAXSYSCALL = 439
pkg syscall (darwin-amd64-cgo), const AF_MAX = 38
pkg syscall (darwin-amd64-cgo), const ELAST = 105
pkg syscall (darwin-amd64-cgo), const EVFILT_SYSCOUNT = 12
pkg syscall (darwin-amd64-cgo), const EVFILT_THREADMARKER = 12
pkg syscall (darwin-amd64-cgo), const IPV6_FRAGTTL = 120
pkg syscall (darwin-amd64-cgo), const SYS_MAXSYSCALL = 439
30 changes: 30 additions & 0 deletions src/pkg/syscall/mkerrors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ includes_Darwin='
#include <netinet/ip.h>
#include <netinet/ip_mroute.h>
#include <termios.h>
// We keep some constants not supported in OS X Mavericks and beyond
// for the promise of compatibility.
#ifndef F_MARKDEPENDENCY
#define F_MARKDEPENDENCY 0x3c
#endif
#ifndef F_READBOOTSTRAP
#define F_READBOOTSTRAP 0x2e
#endif
#ifndef F_WRITEBOOTSTRAP
#define F_WRITEBOOTSTRAP 0x2f
#endif
#ifndef NOTE_RESOURCEEND
#define NOTE_RESOURCEEND 0x2000000
#endif
#ifndef SO_RESTRICTIONS
#define SO_RESTRICTIONS 0x1081
#endif
#ifndef SO_RESTRICT_DENYIN
#define SO_RESTRICT_DENYIN 0x1
#endif
#ifndef SO_RESTRICT_DENYOUT
#define SO_RESTRICT_DENYOUT 0x2
#endif
#ifndef SO_RESTRICT_DENYSET
#define SO_RESTRICT_DENYSET 0x80000000
#endif
#ifndef TCP_MINMSSOVERLOAD
#define TCP_MINMSSOVERLOAD 0x3e8
#endif
'

includes_DragonFly='
Expand Down
28 changes: 27 additions & 1 deletion src/pkg/syscall/mksysnum_darwin.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,41 @@ package syscall
const (
EOF

my %syscalls;

while(<>){
if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){
my $name = $1;
my $num = $2;
$name =~ y/a-z/A-Z/;
print " SYS_$name = $num;"
$syscalls{"SYS_$name"} = "$num";
}
}

# We keep some constants not supported in OS X Mavericks and beyond
# for the promise of compatibility.
$syscalls{"SYS_PROFIL"} = 44;
$syscalls{"SYS_ADD_PROFIL"} = 176;
$syscalls{"SYS_ATSOCKET"} = 206;
$syscalls{"SYS_ATGETMSG"} = 207;
$syscalls{"SYS_ATPUTMSG"} = 208;
$syscalls{"SYS_ATPSNDREQ"} = 209;
$syscalls{"SYS_ATPSNDRSP"} = 210;
$syscalls{"SYS_ATPGETREQ"} = 211;
$syscalls{"SYS_ATPGETRSP"} = 212;
$syscalls{"SYS_MKCOMPLEX"} = 216;
$syscalls{"SYS_STATV"} = 217;
$syscalls{"SYS_LSTATV"} = 218;
$syscalls{"SYS_FSTATV"} = 219;
$syscalls{"SYS_GETAUDIT"} = 355;
$syscalls{"SYS_SETAUDIT"} = 356;
$syscalls{"SYS_PID_HIBERNATE"} = 435;
$syscalls{"SYS_PID_SHUTDOWN_SOCKETS"} = 436;

for my $key (sort {$syscalls{$a} <=> $syscalls{$b} || $a cmp $b} keys %syscalls){
print "$key = $syscalls{$key};\n";
}

print <<EOF;
)
EOF
9 changes: 7 additions & 2 deletions src/pkg/syscall/types_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ struct sockaddr_any {
struct sockaddr addr;
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
};
*/
import "C"

Expand Down Expand Up @@ -117,7 +116,13 @@ type Radvisory_t C.struct_radvisory

type Fbootstraptransfer_t C.struct_fbootstraptransfer

type Log2phys_t C.struct_log2phys
// See golang.org/issue/8267.
//type Log2phys_t C.struct_packed_log2phys
type Log2phys_t struct {
Flags uint32
Contigbytes int64
Devoffset int64
}

type Fsid C.struct_fsid

Expand Down
Loading

0 comments on commit fbd5ad5

Please sign in to comment.