github.com/zach-klippenstein/go@v0.0.0-20150108044943-fcfbeb3adf58/src/syscall/zsyscall_plan9_386.go (about)

     1  // mksyscall.pl -l32 -plan9 syscall_plan9.go
     2  // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
     3  
     4  package syscall
     5  
     6  import "unsafe"
     7  
     8  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
     9  
    10  func fd2path(fd int, buf []byte) (err error) {
    11  	var _p0 unsafe.Pointer
    12  	if len(buf) > 0 {
    13  		_p0 = unsafe.Pointer(&buf[0])
    14  	} else {
    15  		_p0 = unsafe.Pointer(&_zero)
    16  	}
    17  	r0, _, e1 := Syscall(SYS_FD2PATH, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
    18  	if int32(r0) == -1 {
    19  		err = e1
    20  	}
    21  	return
    22  }
    23  
    24  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    25  
    26  func pipe(p *[2]_C_int) (err error) {
    27  	r0, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
    28  	if int32(r0) == -1 {
    29  		err = e1
    30  	}
    31  	return
    32  }
    33  
    34  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    35  
    36  func await(s []byte) (n int, err error) {
    37  	var _p0 unsafe.Pointer
    38  	if len(s) > 0 {
    39  		_p0 = unsafe.Pointer(&s[0])
    40  	} else {
    41  		_p0 = unsafe.Pointer(&_zero)
    42  	}
    43  	r0, _, e1 := Syscall(SYS_AWAIT, uintptr(_p0), uintptr(len(s)), 0)
    44  	n = int(r0)
    45  	if int32(r0) == -1 {
    46  		err = e1
    47  	}
    48  	return
    49  }
    50  
    51  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    52  
    53  func Dup(oldfd int, newfd int) (fd int, err error) {
    54  	r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), uintptr(newfd), 0)
    55  	fd = int(r0)
    56  	if int32(r0) == -1 {
    57  		err = e1
    58  	}
    59  	return
    60  }
    61  
    62  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    63  
    64  func Open(path string, mode int) (fd int, err error) {
    65  	var _p0 *byte
    66  	_p0, err = BytePtrFromString(path)
    67  	if err != nil {
    68  		return
    69  	}
    70  	r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
    71  	use(unsafe.Pointer(_p0))
    72  	fd = int(r0)
    73  	if int32(r0) == -1 {
    74  		err = e1
    75  	}
    76  	return
    77  }
    78  
    79  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    80  
    81  func Create(path string, mode int, perm uint32) (fd int, err error) {
    82  	var _p0 *byte
    83  	_p0, err = BytePtrFromString(path)
    84  	if err != nil {
    85  		return
    86  	}
    87  	r0, _, e1 := Syscall(SYS_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
    88  	use(unsafe.Pointer(_p0))
    89  	fd = int(r0)
    90  	if int32(r0) == -1 {
    91  		err = e1
    92  	}
    93  	return
    94  }
    95  
    96  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    97  
    98  func Remove(path string) (err error) {
    99  	var _p0 *byte
   100  	_p0, err = BytePtrFromString(path)
   101  	if err != nil {
   102  		return
   103  	}
   104  	r0, _, e1 := Syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0)
   105  	use(unsafe.Pointer(_p0))
   106  	if int32(r0) == -1 {
   107  		err = e1
   108  	}
   109  	return
   110  }
   111  
   112  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   113  
   114  func Pread(fd int, p []byte, offset int64) (n int, err error) {
   115  	var _p0 unsafe.Pointer
   116  	if len(p) > 0 {
   117  		_p0 = unsafe.Pointer(&p[0])
   118  	} else {
   119  		_p0 = unsafe.Pointer(&_zero)
   120  	}
   121  	r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
   122  	n = int(r0)
   123  	if int32(r0) == -1 {
   124  		err = e1
   125  	}
   126  	return
   127  }
   128  
   129  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   130  
   131  func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
   132  	var _p0 unsafe.Pointer
   133  	if len(p) > 0 {
   134  		_p0 = unsafe.Pointer(&p[0])
   135  	} else {
   136  		_p0 = unsafe.Pointer(&_zero)
   137  	}
   138  	r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
   139  	n = int(r0)
   140  	if int32(r0) == -1 {
   141  		err = e1
   142  	}
   143  	return
   144  }
   145  
   146  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   147  
   148  func Close(fd int) (err error) {
   149  	r0, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
   150  	if int32(r0) == -1 {
   151  		err = e1
   152  	}
   153  	return
   154  }
   155  
   156  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   157  
   158  func Chdir(path string) (err error) {
   159  	var _p0 *byte
   160  	_p0, err = BytePtrFromString(path)
   161  	if err != nil {
   162  		return
   163  	}
   164  	r0, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
   165  	use(unsafe.Pointer(_p0))
   166  	if int32(r0) == -1 {
   167  		err = e1
   168  	}
   169  	return
   170  }
   171  
   172  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   173  
   174  func Bind(name string, old string, flag int) (err error) {
   175  	var _p0 *byte
   176  	_p0, err = BytePtrFromString(name)
   177  	if err != nil {
   178  		return
   179  	}
   180  	var _p1 *byte
   181  	_p1, err = BytePtrFromString(old)
   182  	if err != nil {
   183  		return
   184  	}
   185  	r0, _, e1 := Syscall(SYS_BIND, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag))
   186  	use(unsafe.Pointer(_p0))
   187  	use(unsafe.Pointer(_p1))
   188  	if int32(r0) == -1 {
   189  		err = e1
   190  	}
   191  	return
   192  }
   193  
   194  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   195  
   196  func Mount(fd int, afd int, old string, flag int, aname string) (err error) {
   197  	var _p0 *byte
   198  	_p0, err = BytePtrFromString(old)
   199  	if err != nil {
   200  		return
   201  	}
   202  	var _p1 *byte
   203  	_p1, err = BytePtrFromString(aname)
   204  	if err != nil {
   205  		return
   206  	}
   207  	r0, _, e1 := Syscall6(SYS_MOUNT, uintptr(fd), uintptr(afd), uintptr(unsafe.Pointer(_p0)), uintptr(flag), uintptr(unsafe.Pointer(_p1)), 0)
   208  	use(unsafe.Pointer(_p0))
   209  	use(unsafe.Pointer(_p1))
   210  	if int32(r0) == -1 {
   211  		err = e1
   212  	}
   213  	return
   214  }
   215  
   216  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   217  
   218  func Stat(path string, edir []byte) (n int, err error) {
   219  	var _p0 *byte
   220  	_p0, err = BytePtrFromString(path)
   221  	if err != nil {
   222  		return
   223  	}
   224  	var _p1 unsafe.Pointer
   225  	if len(edir) > 0 {
   226  		_p1 = unsafe.Pointer(&edir[0])
   227  	} else {
   228  		_p1 = unsafe.Pointer(&_zero)
   229  	}
   230  	r0, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))
   231  	use(unsafe.Pointer(_p0))
   232  	n = int(r0)
   233  	if int32(r0) == -1 {
   234  		err = e1
   235  	}
   236  	return
   237  }
   238  
   239  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   240  
   241  func Fstat(fd int, edir []byte) (n int, err error) {
   242  	var _p0 unsafe.Pointer
   243  	if len(edir) > 0 {
   244  		_p0 = unsafe.Pointer(&edir[0])
   245  	} else {
   246  		_p0 = unsafe.Pointer(&_zero)
   247  	}
   248  	r0, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))
   249  	n = int(r0)
   250  	if int32(r0) == -1 {
   251  		err = e1
   252  	}
   253  	return
   254  }
   255  
   256  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   257  
   258  func Wstat(path string, edir []byte) (err error) {
   259  	var _p0 *byte
   260  	_p0, err = BytePtrFromString(path)
   261  	if err != nil {
   262  		return
   263  	}
   264  	var _p1 unsafe.Pointer
   265  	if len(edir) > 0 {
   266  		_p1 = unsafe.Pointer(&edir[0])
   267  	} else {
   268  		_p1 = unsafe.Pointer(&_zero)
   269  	}
   270  	r0, _, e1 := Syscall(SYS_WSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(edir)))
   271  	use(unsafe.Pointer(_p0))
   272  	if int32(r0) == -1 {
   273  		err = e1
   274  	}
   275  	return
   276  }
   277  
   278  // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
   279  
   280  func Fwstat(fd int, edir []byte) (err error) {
   281  	var _p0 unsafe.Pointer
   282  	if len(edir) > 0 {
   283  		_p0 = unsafe.Pointer(&edir[0])
   284  	} else {
   285  		_p0 = unsafe.Pointer(&_zero)
   286  	}
   287  	r0, _, e1 := Syscall(SYS_FWSTAT, uintptr(fd), uintptr(_p0), uintptr(len(edir)))
   288  	if int32(r0) == -1 {
   289  		err = e1
   290  	}
   291  	return
   292  }