diff options
author | Russ Cox <rsc@golang.org> | 2009-03-24 15:04:18 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-03-24 15:04:18 -0700 |
commit | 54568208f5c893218268baede6f8d0868fa6af97 (patch) | |
tree | 3ecf5c330d15193f7f4aa3fdd55a3bd7152eecf2 /src/runtime/linux/defs.c | |
parent | 30c27d9b1fa84d00f18845ff253e9f8293fbf918 (diff) | |
download | golang-54568208f5c893218268baede6f8d0868fa6af97.tar.gz |
convert Linux to auto-generated defs.h
TBR=r
OCL=26686
CL=26688
Diffstat (limited to 'src/runtime/linux/defs.c')
-rw-r--r-- | src/runtime/linux/defs.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/runtime/linux/defs.c b/src/runtime/linux/defs.c new file mode 100644 index 000000000..9e635b429 --- /dev/null +++ b/src/runtime/linux/defs.c @@ -0,0 +1,42 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + * Input to godefs + godefs -f -m64 defs.c >amd64/defs.h + godefs -f -m64 defs1.c >>amd64/defs.h + godefs defs.c >386/defs.h + godefs defs1.c >>386/defs.h + */ + +// Linux glibc and Linux kernel define different and conflicting +// definitions for struct sigaction, struct timespec, etc. +// We want the kernel ones, which are in the asm/* headers. +// But then we'd get conflicts when we include the system +// headers for things like ucontext_t, so that happens in +// a separate file, defs1.c. + +#include <asm/signal.h> +#include <asm/siginfo.h> +#include <asm/mman.h> + +enum { + $PROT_NONE = PROT_NONE, + $PROT_READ = PROT_READ, + $PROT_WRITE = PROT_WRITE, + $PROT_EXEC = PROT_EXEC, + + $MAP_ANON = MAP_ANONYMOUS, + $MAP_PRIVATE = MAP_PRIVATE, + + $SA_RESTART = SA_RESTART, + $SA_ONSTACK = SA_ONSTACK, + $SA_RESTORER = SA_RESTORER, + $SA_SIGINFO = SA_SIGINFO, +}; + +typedef struct timespec $Timespec; +typedef struct timeval $Timeval; +typedef struct sigaction $Sigaction; +typedef siginfo_t $Siginfo; |