// auto generated by go tool dist
// goos=solaris goarch=amd64


#include "runtime.h"
#include "defs_GOOS_GOARCH.h"
#include "os_GOOS.h"
#include "cgocall.h"
#include "../../cmd/ld/textflag.h"
#pragma dynimport libc·chdir chdir "libc.so"
#pragma dynimport libc·chroot chroot "libc.so"
#pragma dynimport libc·close close "libc.so"
#pragma dynimport libc·dlclose dlclose "libc.so"
#pragma dynimport libc·dlopen dlopen "libc.so"
#pragma dynimport libc·dlsym dlsym "libc.so"
#pragma dynimport libc·execve execve "libc.so"
#pragma dynimport libc·fcntl fcntl "libc.so"
#pragma dynimport libc·gethostname gethostname "libc.so"
#pragma dynimport libc·ioctl ioctl "libc.so"
#pragma dynimport libc·pipe pipe "libc.so"
#pragma dynimport libc·setgid setgid "libc.so"
#pragma dynimport libc·setgroups setgroups "libc.so"
#pragma dynimport libc·setsid setsid "libc.so"
#pragma dynimport libc·setuid setuid "libc.so"
#pragma dynimport libc·setpgid setsid "libc.so"
#pragma dynimport libc·syscall syscall "libc.so"
#pragma dynimport libc·forkx forkx "libc.so"
#pragma dynimport libc·wait4 wait4 "libc.so"

#line 31 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"
extern uintptr libc·chdir; 
extern uintptr libc·chroot; 
extern uintptr libc·close; 
extern uintptr libc·dlclose; 
extern uintptr libc·dlopen; 
extern uintptr libc·dlsym; 
extern uintptr libc·execve; 
extern uintptr libc·exit; 
extern uintptr libc·fcntl; 
extern uintptr libc·gethostname; 
extern uintptr libc·ioctl; 
extern uintptr libc·pipe; 
extern uintptr libc·setgid; 
extern uintptr libc·setgroups; 
extern uintptr libc·setsid; 
extern uintptr libc·setuid; 
extern uintptr libc·setpgid; 
extern uintptr libc·syscall; 
extern uintptr libc·forkx; 
extern uintptr libc·wait4; 
extern uintptr libc·write; 
void
syscall·sysvicall6(uintptr func, uintptr nargs, uintptr a1, uintptr a2, uintptr a3, uintptr a4, uintptr a5, uintptr a6, uintptr r1, uintptr r2, uintptr err)
{
	r1 = 0;
	FLUSH(&r1);
	r2 = 0;
	FLUSH(&r2);
	err = 0;
	FLUSH(&err);
#line 54 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(a2);
	USED(a3);
	USED(a4);
	USED(a5);
	USED(a6);
	c.fn = (void*)func;
	c.n = nargs;
	c.args = (void*)&a1;
	runtime·cgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	r1 = c.r1;
	r2 = c.r2;
	FLUSH(&r1);
	FLUSH(&r2);
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·rawSysvicall6(uintptr func, uintptr nargs, uintptr a1, uintptr a2, uintptr a3, uintptr a4, uintptr a5, uintptr a6, uintptr r1, uintptr r2, uintptr err)
{
	r1 = 0;
	FLUSH(&r1);
	r2 = 0;
	FLUSH(&r2);
	err = 0;
	FLUSH(&err);
#line 73 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(a2);
	USED(a3);
	USED(a4);
	USED(a5);
	USED(a6);
	c.fn = (void*)func;
	c.n = nargs;
	c.args = (void*)&a1;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	r1 = c.r1;
	r2 = c.r2;
	FLUSH(&r1);
	FLUSH(&r2);
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·chdir(uintptr path, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 91 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	c.fn = (void*)libc·chdir;
	c.n = 1;
	c.args = (void*)&path;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·chroot1(uintptr path, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 102 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	c.fn = (void*)libc·chroot;
	c.n = 1;
	c.args = (void*)&path;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·close(uintptr fd, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 113 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	c.fn = (void*)libc·close;
	c.n = 1;
	c.args = (void*)&fd;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	FLUSH(&err);
}
void
syscall·dlclose(uintptr handle, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 123 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(handle);
	c.fn = (void*)libc·dlclose;
	c.n = 1;
	c.args = (void*)&handle;
	runtime·cgocall(runtime·asmsysvicall6, &c);
	err = c.r1;
	FLUSH(&err);
}
void
syscall·dlopen(uint8* name, uintptr mode, uintptr handle, uintptr err)
{
	handle = 0;
	FLUSH(&handle);
	err = 0;
	FLUSH(&err);
#line 134 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(mode);
	c.fn = (void*)libc·dlopen;
	c.n = 2;
	c.args = (void*)&name;
	runtime·cgocall(runtime·asmsysvicall6, &c);
	handle = c.r1;
	if(handle == 0)
		err = c.err;
	else
		err = 0;
	FLUSH(&handle);
	FLUSH(&err);
}
void
syscall·dlsym(uintptr handle, uint8* name, uintptr proc, uintptr err)
{
	proc = 0;
	FLUSH(&proc);
	err = 0;
	FLUSH(&err);
#line 149 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(name);
	c.fn = (void*)libc·dlsym;
	c.n = 2;
	c.args = &handle;
	runtime·cgocall(runtime·asmsysvicall6, &c);
	proc = c.r1;
	if(proc == 0)
		err = c.err;
	else
		err = 0;
	FLUSH(&proc);
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·execve(uintptr path, uintptr argv, uintptr envp, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 165 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(argv);
	USED(envp);
	c.fn = (void*)libc·execve;
	c.n = 3;
	c.args = (void*)&path;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·exit(uintptr code)
{
#line 178 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	c.fn = (void*)libc·exit;
	c.n = 1;
	c.args = (void*)&code;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
}

#pragma textflag NOSPLIT
void
syscall·fcntl1(uintptr fd, uintptr cmd, uintptr arg, uintptr val, uintptr err)
{
	val = 0;
	FLUSH(&val);
	err = 0;
	FLUSH(&err);
#line 188 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(cmd);
	USED(arg);
	c.fn = (void*)libc·fcntl;
	c.n = 3;
	c.args = (void*)&fd;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	val = c.r1;
	FLUSH(&val);
	FLUSH(&err);
}
void
syscall·gethostname(String name, uintptr err)
{
	name.str = 0;
	name.len = 0;
	FLUSH(&name);
	err = 0;
	FLUSH(&err);
#line 201 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	struct { uintptr v[2]; } args;
	uint8 cname[MAXHOSTNAMELEN];
	LibCall c;

	c.fn = (void*)libc·gethostname;
	c.n = 2;
	args.v[0] = (uintptr)&cname[0];
	args.v[1] = MAXHOSTNAMELEN;
	c.args = (void*)&args;
	runtime·cgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	if(c.r1) {
		name = runtime·emptystring;
		return;
	}
	cname[MAXHOSTNAMELEN - 1] = 0;
	name = runtime·gostring(cname);
	FLUSH(&name);
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·ioctl(uintptr fd, uintptr req, uintptr arg, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 222 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(req);
	USED(arg);
	c.fn = (void*)libc·ioctl;
	c.n = 3;
	c.args = (void*)&fd;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	FLUSH(&err);
}
void
syscall·wait4(uintptr pid, uint32* wstatus, uintptr options, void* rusage, intgo wpid, uintptr err)
{
	wpid = 0;
	FLUSH(&wpid);
	err = 0;
	FLUSH(&err);
#line 234 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(wstatus);
	USED(options);
	USED(rusage);
	c.fn = (void*)libc·wait4;
	c.n = 4;
	c.args = (void*)&pid;
	runtime·cgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	wpid = c.r1;
	FLUSH(&wpid);
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·setgid(uintptr gid, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 249 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	c.fn = (void*)libc·setgid;
	c.n = 1;
	c.args = (void*)&gid;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·setgroups1(uintptr ngid, uintptr gid, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 260 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(gid);
	c.fn = (void*)libc·setgroups;
	c.n = 2;
	c.args = (void*)&ngid;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·setsid(uintptr pid, uintptr err)
{
	pid = 0;
	FLUSH(&pid);
	err = 0;
	FLUSH(&err);
#line 272 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	c.fn = (void*)libc·setsid;
	c.n = 0;
	c.args = (void*)0;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	pid = c.r1;
	FLUSH(&pid);
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·setuid(uintptr uid, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 284 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	c.fn = (void*)libc·setuid;
	c.n = 1;
	c.args = (void*)&uid;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·setpgid(uintptr pid, uintptr pgid, uintptr err)
{
	err = 0;
	FLUSH(&err);
#line 295 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(pgid);
	c.fn = (void*)libc·setpgid;
	c.n = 2;
	c.args = (void*)&pid;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·forkx(uintptr flags, uintptr pid, uintptr err)
{
	pid = 0;
	FLUSH(&pid);
	err = 0;
	FLUSH(&err);
#line 307 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	c.fn = (void*)libc·forkx;
	c.n = 1;
	c.args = (void*)&flags;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	pid = c.r1;
	FLUSH(&pid);
	FLUSH(&err);
}

#line 318 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"
void runtime·pipe1 ( void ) ; 
void
syscall·pipe(uintptr r, uintptr w, uintptr err)
{
	r = 0;
	FLUSH(&r);
	w = 0;
	FLUSH(&w);
	err = 0;
	FLUSH(&err);
#line 320 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	c.fn = (void*)runtime·pipe1;
	c.n = 0;
	c.args = (void*)0;
	runtime·cgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	r = c.r1;
	w = c.r2;
	FLUSH(&r);
	FLUSH(&w);
	FLUSH(&err);
}

#pragma textflag NOSPLIT
void
syscall·write1(uintptr fd, uintptr buf, uintptr nbyte, uintptr n, uintptr err)
{
	n = 0;
	FLUSH(&n);
	err = 0;
	FLUSH(&err);
#line 333 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(buf);
	USED(nbyte);
	c.fn = (void*)libc·write;
	c.n = 3;
	c.args = (void*)fd;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	n = c.r1;
	FLUSH(&n);
	FLUSH(&err);
}
void
syscall·Syscall(uintptr trap, uintptr a1, uintptr a2, uintptr a3, uintptr r1, uintptr r2, uintptr err)
{
	r1 = 0;
	FLUSH(&r1);
	r2 = 0;
	FLUSH(&r2);
	err = 0;
	FLUSH(&err);
#line 346 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(a1);
	USED(a2);
	USED(a3);
	c.fn = (void*)libc·syscall;
	c.n = 4;
	c.args = &trap;
	runtime·cgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	r1 = c.r1;
	r2 = c.r2;
	FLUSH(&r1);
	FLUSH(&r2);
	FLUSH(&err);
}
void
syscall·RawSyscall(uintptr trap, uintptr a1, uintptr a2, uintptr a3, uintptr r1, uintptr r2, uintptr err)
{
	r1 = 0;
	FLUSH(&r1);
	r2 = 0;
	FLUSH(&r2);
	err = 0;
	FLUSH(&err);
#line 361 "/home/pbulk/build/lang/go/work/go/src/pkg/runtime/syscall_solaris.goc"

	LibCall c;

	USED(a1);
	USED(a2);
	USED(a3);
	c.fn = (void*)libc·syscall;
	c.n = 4;
	c.args = &trap;
	runtime·asmcgocall(runtime·asmsysvicall6, &c);
	err = c.err;
	r1 = c.r1;
	r2 = c.r2;
	FLUSH(&r1);
	FLUSH(&r2);
	FLUSH(&err);
}
