diff options
author | Russ Cox <rsc@golang.org> | 2009-09-22 07:49:31 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-09-22 07:49:31 -0700 |
commit | 5c68a98ecad84edb4f00e7194759b575913b35bf (patch) | |
tree | 559a6c61ae320938538c0decd4018efbc42d666f /src/pkg/syscall/types_nacl.c | |
parent | 00c5348f530f965b6fc663a54a01448913a1512f (diff) | |
download | golang-5c68a98ecad84edb4f00e7194759b575913b35bf.tar.gz |
nacl syscall package.
similar tweaks to make debug/proc, net, os build.
R=r
DELTA=861 (855 added, 4 deleted, 2 changed)
OCL=34877
CL=34890
Diffstat (limited to 'src/pkg/syscall/types_nacl.c')
-rw-r--r-- | src/pkg/syscall/types_nacl.c | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/src/pkg/syscall/types_nacl.c b/src/pkg/syscall/types_nacl.c new file mode 100644 index 000000000..f594061a2 --- /dev/null +++ b/src/pkg/syscall/types_nacl.c @@ -0,0 +1,115 @@ +// 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. See PORT.sh + */ + +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#define _FILE_OFFSET_BITS 64 +#define _GNU_SOURCE + +#define __native_client__ 1 + +#define suseconds_t nacl_suseconds_t_1 +#include <sys/types.h> +#undef suseconds_t + +#include <sys/dirent.h> +#include <sys/mman.h> +#include <sys/fcntl.h> +#include <sys/stat.h> +#include <sys/time.h> +#include <sys/unistd.h> + +// Machine characteristics; for internal use. + +enum +{ + $sizeofPtr = sizeof(void*), + $sizeofShort = sizeof(short), + $sizeofInt = sizeof(int), + $sizeofLong = sizeof(long), + $sizeofLongLong = sizeof(long long), +}; + + +// Unimplemented system calls +enum { + $SYS_FORK = 0, + $SYS_PTRACE = 0, + $SYS_CHDIR = 0, + $SYS_DUP2 = 0, + $SYS_FCNTL = 0, + $SYS_EXECVE = 0 +}; + +// Basic types + +typedef short $_C_short; +typedef int $_C_int; +typedef long $_C_long; +typedef long long $_C_long_long; +typedef off_t $_C_off_t; + +// Time + +typedef struct timespec $Timespec; +typedef struct timeval $Timeval; +typedef time_t $Time_t; + +// Processes + +//typedef struct rusage $Rusage; +//typedef struct rlimit $Rlimit; + +typedef gid_t $_Gid_t; + +// Files + +enum +{ + $O_RDONLY = O_RDONLY, + $O_WRONLY = O_WRONLY, + $O_RDWR = O_RDWR, + $O_APPEND = O_APPEND, + $O_ASYNC = O_ASYNC, + $O_CREAT = O_CREAT, + $O_NOCTTY = 0, // not supported + $O_NONBLOCK = O_NONBLOCK, + $O_SYNC = O_SYNC, + $O_TRUNC = O_TRUNC, + $O_CLOEXEC = 0, // not supported + + $F_GETFD = F_GETFD, + $F_SETFD = F_SETFD, + + $F_GETFL = F_GETFL, + $F_SETFL = F_SETFL, + + $FD_CLOEXEC = 0, // not supported +}; + +enum +{ // Directory mode bits + $S_IFMT = S_IFMT, + $S_IFIFO = S_IFIFO, + $S_IFCHR = S_IFCHR, + $S_IFDIR = S_IFDIR, + $S_IFBLK = S_IFBLK, + $S_IFREG = S_IFREG, + $S_IFLNK = S_IFLNK, + $S_IFSOCK = S_IFSOCK, + $S_ISUID = S_ISUID, + $S_ISGID = S_ISGID, + $S_ISVTX = S_ISVTX, + $S_IRUSR = S_IRUSR, + $S_IWUSR = S_IWUSR, + $S_IXUSR = S_IXUSR, +}; + +typedef struct stat $Stat_t; + +typedef struct dirent $Dirent; |