zsyscall_netbsd_386.go 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327
  1. // mksyscall.pl -l32 -netbsd syscall_bsd.go syscall_netbsd.go syscall_netbsd_386.go
  2. // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  3. // +build 386,netbsd
  4. package unix
  5. import (
  6. "syscall"
  7. "unsafe"
  8. )
  9. var _ syscall.Errno
  10. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  11. func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
  12. r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
  13. n = int(r0)
  14. if e1 != 0 {
  15. err = errnoErr(e1)
  16. }
  17. return
  18. }
  19. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  20. func setgroups(ngid int, gid *_Gid_t) (err error) {
  21. _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
  22. if e1 != 0 {
  23. err = errnoErr(e1)
  24. }
  25. return
  26. }
  27. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  28. func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
  29. r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
  30. wpid = int(r0)
  31. if e1 != 0 {
  32. err = errnoErr(e1)
  33. }
  34. return
  35. }
  36. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  37. func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
  38. r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
  39. fd = int(r0)
  40. if e1 != 0 {
  41. err = errnoErr(e1)
  42. }
  43. return
  44. }
  45. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  46. func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
  47. _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
  48. if e1 != 0 {
  49. err = errnoErr(e1)
  50. }
  51. return
  52. }
  53. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  54. func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
  55. _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
  56. if e1 != 0 {
  57. err = errnoErr(e1)
  58. }
  59. return
  60. }
  61. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  62. func socket(domain int, typ int, proto int) (fd int, err error) {
  63. r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
  64. fd = int(r0)
  65. if e1 != 0 {
  66. err = errnoErr(e1)
  67. }
  68. return
  69. }
  70. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  71. func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
  72. _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
  73. if e1 != 0 {
  74. err = errnoErr(e1)
  75. }
  76. return
  77. }
  78. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  79. func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
  80. _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
  81. if e1 != 0 {
  82. err = errnoErr(e1)
  83. }
  84. return
  85. }
  86. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  87. func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
  88. _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
  89. if e1 != 0 {
  90. err = errnoErr(e1)
  91. }
  92. return
  93. }
  94. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  95. func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
  96. _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
  97. if e1 != 0 {
  98. err = errnoErr(e1)
  99. }
  100. return
  101. }
  102. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  103. func Shutdown(s int, how int) (err error) {
  104. _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
  105. if e1 != 0 {
  106. err = errnoErr(e1)
  107. }
  108. return
  109. }
  110. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  111. func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
  112. _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
  113. if e1 != 0 {
  114. err = errnoErr(e1)
  115. }
  116. return
  117. }
  118. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  119. func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
  120. var _p0 unsafe.Pointer
  121. if len(p) > 0 {
  122. _p0 = unsafe.Pointer(&p[0])
  123. } else {
  124. _p0 = unsafe.Pointer(&_zero)
  125. }
  126. r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
  127. n = int(r0)
  128. if e1 != 0 {
  129. err = errnoErr(e1)
  130. }
  131. return
  132. }
  133. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  134. func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
  135. var _p0 unsafe.Pointer
  136. if len(buf) > 0 {
  137. _p0 = unsafe.Pointer(&buf[0])
  138. } else {
  139. _p0 = unsafe.Pointer(&_zero)
  140. }
  141. _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
  142. if e1 != 0 {
  143. err = errnoErr(e1)
  144. }
  145. return
  146. }
  147. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  148. func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
  149. r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
  150. n = int(r0)
  151. if e1 != 0 {
  152. err = errnoErr(e1)
  153. }
  154. return
  155. }
  156. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  157. func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
  158. r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
  159. n = int(r0)
  160. if e1 != 0 {
  161. err = errnoErr(e1)
  162. }
  163. return
  164. }
  165. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  166. func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
  167. r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
  168. n = int(r0)
  169. if e1 != 0 {
  170. err = errnoErr(e1)
  171. }
  172. return
  173. }
  174. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  175. func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
  176. var _p0 unsafe.Pointer
  177. if len(mib) > 0 {
  178. _p0 = unsafe.Pointer(&mib[0])
  179. } else {
  180. _p0 = unsafe.Pointer(&_zero)
  181. }
  182. _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
  183. use(_p0)
  184. if e1 != 0 {
  185. err = errnoErr(e1)
  186. }
  187. return
  188. }
  189. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  190. func utimes(path string, timeval *[2]Timeval) (err error) {
  191. var _p0 *byte
  192. _p0, err = BytePtrFromString(path)
  193. if err != nil {
  194. return
  195. }
  196. _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
  197. use(unsafe.Pointer(_p0))
  198. if e1 != 0 {
  199. err = errnoErr(e1)
  200. }
  201. return
  202. }
  203. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  204. func futimes(fd int, timeval *[2]Timeval) (err error) {
  205. _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
  206. if e1 != 0 {
  207. err = errnoErr(e1)
  208. }
  209. return
  210. }
  211. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  212. func fcntl(fd int, cmd int, arg int) (val int, err error) {
  213. r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
  214. val = int(r0)
  215. if e1 != 0 {
  216. err = errnoErr(e1)
  217. }
  218. return
  219. }
  220. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  221. func pipe() (fd1 int, fd2 int, err error) {
  222. r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
  223. fd1 = int(r0)
  224. fd2 = int(r1)
  225. if e1 != 0 {
  226. err = errnoErr(e1)
  227. }
  228. return
  229. }
  230. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  231. func getdents(fd int, buf []byte) (n int, err error) {
  232. var _p0 unsafe.Pointer
  233. if len(buf) > 0 {
  234. _p0 = unsafe.Pointer(&buf[0])
  235. } else {
  236. _p0 = unsafe.Pointer(&_zero)
  237. }
  238. r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
  239. n = int(r0)
  240. if e1 != 0 {
  241. err = errnoErr(e1)
  242. }
  243. return
  244. }
  245. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  246. func Access(path string, mode uint32) (err error) {
  247. var _p0 *byte
  248. _p0, err = BytePtrFromString(path)
  249. if err != nil {
  250. return
  251. }
  252. _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
  253. use(unsafe.Pointer(_p0))
  254. if e1 != 0 {
  255. err = errnoErr(e1)
  256. }
  257. return
  258. }
  259. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  260. func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
  261. _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
  262. if e1 != 0 {
  263. err = errnoErr(e1)
  264. }
  265. return
  266. }
  267. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  268. func Chdir(path string) (err error) {
  269. var _p0 *byte
  270. _p0, err = BytePtrFromString(path)
  271. if err != nil {
  272. return
  273. }
  274. _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
  275. use(unsafe.Pointer(_p0))
  276. if e1 != 0 {
  277. err = errnoErr(e1)
  278. }
  279. return
  280. }
  281. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  282. func Chflags(path string, flags int) (err error) {
  283. var _p0 *byte
  284. _p0, err = BytePtrFromString(path)
  285. if err != nil {
  286. return
  287. }
  288. _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
  289. use(unsafe.Pointer(_p0))
  290. if e1 != 0 {
  291. err = errnoErr(e1)
  292. }
  293. return
  294. }
  295. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  296. func Chmod(path string, mode uint32) (err error) {
  297. var _p0 *byte
  298. _p0, err = BytePtrFromString(path)
  299. if err != nil {
  300. return
  301. }
  302. _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
  303. use(unsafe.Pointer(_p0))
  304. if e1 != 0 {
  305. err = errnoErr(e1)
  306. }
  307. return
  308. }
  309. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  310. func Chown(path string, uid int, gid int) (err error) {
  311. var _p0 *byte
  312. _p0, err = BytePtrFromString(path)
  313. if err != nil {
  314. return
  315. }
  316. _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
  317. use(unsafe.Pointer(_p0))
  318. if e1 != 0 {
  319. err = errnoErr(e1)
  320. }
  321. return
  322. }
  323. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  324. func Chroot(path string) (err error) {
  325. var _p0 *byte
  326. _p0, err = BytePtrFromString(path)
  327. if err != nil {
  328. return
  329. }
  330. _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
  331. use(unsafe.Pointer(_p0))
  332. if e1 != 0 {
  333. err = errnoErr(e1)
  334. }
  335. return
  336. }
  337. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  338. func Close(fd int) (err error) {
  339. _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
  340. if e1 != 0 {
  341. err = errnoErr(e1)
  342. }
  343. return
  344. }
  345. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  346. func Dup(fd int) (nfd int, err error) {
  347. r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
  348. nfd = int(r0)
  349. if e1 != 0 {
  350. err = errnoErr(e1)
  351. }
  352. return
  353. }
  354. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  355. func Dup2(from int, to int) (err error) {
  356. _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
  357. if e1 != 0 {
  358. err = errnoErr(e1)
  359. }
  360. return
  361. }
  362. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  363. func Exit(code int) {
  364. Syscall(SYS_EXIT, uintptr(code), 0, 0)
  365. return
  366. }
  367. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  368. func Fchdir(fd int) (err error) {
  369. _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
  370. if e1 != 0 {
  371. err = errnoErr(e1)
  372. }
  373. return
  374. }
  375. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  376. func Fchflags(fd int, flags int) (err error) {
  377. _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
  378. if e1 != 0 {
  379. err = errnoErr(e1)
  380. }
  381. return
  382. }
  383. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  384. func Fchmod(fd int, mode uint32) (err error) {
  385. _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
  386. if e1 != 0 {
  387. err = errnoErr(e1)
  388. }
  389. return
  390. }
  391. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  392. func Fchown(fd int, uid int, gid int) (err error) {
  393. _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
  394. if e1 != 0 {
  395. err = errnoErr(e1)
  396. }
  397. return
  398. }
  399. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  400. func Flock(fd int, how int) (err error) {
  401. _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
  402. if e1 != 0 {
  403. err = errnoErr(e1)
  404. }
  405. return
  406. }
  407. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  408. func Fpathconf(fd int, name int) (val int, err error) {
  409. r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
  410. val = int(r0)
  411. if e1 != 0 {
  412. err = errnoErr(e1)
  413. }
  414. return
  415. }
  416. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  417. func Fstat(fd int, stat *Stat_t) (err error) {
  418. _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
  419. if e1 != 0 {
  420. err = errnoErr(e1)
  421. }
  422. return
  423. }
  424. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  425. func Fsync(fd int) (err error) {
  426. _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
  427. if e1 != 0 {
  428. err = errnoErr(e1)
  429. }
  430. return
  431. }
  432. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  433. func Ftruncate(fd int, length int64) (err error) {
  434. _, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)
  435. if e1 != 0 {
  436. err = errnoErr(e1)
  437. }
  438. return
  439. }
  440. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  441. func Getegid() (egid int) {
  442. r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
  443. egid = int(r0)
  444. return
  445. }
  446. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  447. func Geteuid() (uid int) {
  448. r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
  449. uid = int(r0)
  450. return
  451. }
  452. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  453. func Getgid() (gid int) {
  454. r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
  455. gid = int(r0)
  456. return
  457. }
  458. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  459. func Getpgid(pid int) (pgid int, err error) {
  460. r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
  461. pgid = int(r0)
  462. if e1 != 0 {
  463. err = errnoErr(e1)
  464. }
  465. return
  466. }
  467. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  468. func Getpgrp() (pgrp int) {
  469. r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
  470. pgrp = int(r0)
  471. return
  472. }
  473. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  474. func Getpid() (pid int) {
  475. r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
  476. pid = int(r0)
  477. return
  478. }
  479. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  480. func Getppid() (ppid int) {
  481. r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
  482. ppid = int(r0)
  483. return
  484. }
  485. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  486. func Getpriority(which int, who int) (prio int, err error) {
  487. r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
  488. prio = int(r0)
  489. if e1 != 0 {
  490. err = errnoErr(e1)
  491. }
  492. return
  493. }
  494. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  495. func Getrlimit(which int, lim *Rlimit) (err error) {
  496. _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
  497. if e1 != 0 {
  498. err = errnoErr(e1)
  499. }
  500. return
  501. }
  502. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  503. func Getrusage(who int, rusage *Rusage) (err error) {
  504. _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
  505. if e1 != 0 {
  506. err = errnoErr(e1)
  507. }
  508. return
  509. }
  510. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  511. func Getsid(pid int) (sid int, err error) {
  512. r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
  513. sid = int(r0)
  514. if e1 != 0 {
  515. err = errnoErr(e1)
  516. }
  517. return
  518. }
  519. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  520. func Gettimeofday(tv *Timeval) (err error) {
  521. _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
  522. if e1 != 0 {
  523. err = errnoErr(e1)
  524. }
  525. return
  526. }
  527. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  528. func Getuid() (uid int) {
  529. r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
  530. uid = int(r0)
  531. return
  532. }
  533. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  534. func Issetugid() (tainted bool) {
  535. r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)
  536. tainted = bool(r0 != 0)
  537. return
  538. }
  539. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  540. func Kill(pid int, signum syscall.Signal) (err error) {
  541. _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
  542. if e1 != 0 {
  543. err = errnoErr(e1)
  544. }
  545. return
  546. }
  547. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  548. func Kqueue() (fd int, err error) {
  549. r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
  550. fd = int(r0)
  551. if e1 != 0 {
  552. err = errnoErr(e1)
  553. }
  554. return
  555. }
  556. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  557. func Lchown(path string, uid int, gid int) (err error) {
  558. var _p0 *byte
  559. _p0, err = BytePtrFromString(path)
  560. if err != nil {
  561. return
  562. }
  563. _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
  564. use(unsafe.Pointer(_p0))
  565. if e1 != 0 {
  566. err = errnoErr(e1)
  567. }
  568. return
  569. }
  570. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  571. func Link(path string, link string) (err error) {
  572. var _p0 *byte
  573. _p0, err = BytePtrFromString(path)
  574. if err != nil {
  575. return
  576. }
  577. var _p1 *byte
  578. _p1, err = BytePtrFromString(link)
  579. if err != nil {
  580. return
  581. }
  582. _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
  583. use(unsafe.Pointer(_p0))
  584. use(unsafe.Pointer(_p1))
  585. if e1 != 0 {
  586. err = errnoErr(e1)
  587. }
  588. return
  589. }
  590. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  591. func Listen(s int, backlog int) (err error) {
  592. _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
  593. if e1 != 0 {
  594. err = errnoErr(e1)
  595. }
  596. return
  597. }
  598. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  599. func Lstat(path string, stat *Stat_t) (err error) {
  600. var _p0 *byte
  601. _p0, err = BytePtrFromString(path)
  602. if err != nil {
  603. return
  604. }
  605. _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
  606. use(unsafe.Pointer(_p0))
  607. if e1 != 0 {
  608. err = errnoErr(e1)
  609. }
  610. return
  611. }
  612. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  613. func Mkdir(path string, mode uint32) (err error) {
  614. var _p0 *byte
  615. _p0, err = BytePtrFromString(path)
  616. if err != nil {
  617. return
  618. }
  619. _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
  620. use(unsafe.Pointer(_p0))
  621. if e1 != 0 {
  622. err = errnoErr(e1)
  623. }
  624. return
  625. }
  626. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  627. func Mkfifo(path string, mode uint32) (err error) {
  628. var _p0 *byte
  629. _p0, err = BytePtrFromString(path)
  630. if err != nil {
  631. return
  632. }
  633. _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
  634. use(unsafe.Pointer(_p0))
  635. if e1 != 0 {
  636. err = errnoErr(e1)
  637. }
  638. return
  639. }
  640. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  641. func Mknod(path string, mode uint32, dev int) (err error) {
  642. var _p0 *byte
  643. _p0, err = BytePtrFromString(path)
  644. if err != nil {
  645. return
  646. }
  647. _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
  648. use(unsafe.Pointer(_p0))
  649. if e1 != 0 {
  650. err = errnoErr(e1)
  651. }
  652. return
  653. }
  654. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  655. func Mlock(b []byte) (err error) {
  656. var _p0 unsafe.Pointer
  657. if len(b) > 0 {
  658. _p0 = unsafe.Pointer(&b[0])
  659. } else {
  660. _p0 = unsafe.Pointer(&_zero)
  661. }
  662. _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
  663. if e1 != 0 {
  664. err = errnoErr(e1)
  665. }
  666. return
  667. }
  668. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  669. func Mlockall(flags int) (err error) {
  670. _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
  671. if e1 != 0 {
  672. err = errnoErr(e1)
  673. }
  674. return
  675. }
  676. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  677. func Mprotect(b []byte, prot int) (err error) {
  678. var _p0 unsafe.Pointer
  679. if len(b) > 0 {
  680. _p0 = unsafe.Pointer(&b[0])
  681. } else {
  682. _p0 = unsafe.Pointer(&_zero)
  683. }
  684. _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
  685. if e1 != 0 {
  686. err = errnoErr(e1)
  687. }
  688. return
  689. }
  690. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  691. func Munlock(b []byte) (err error) {
  692. var _p0 unsafe.Pointer
  693. if len(b) > 0 {
  694. _p0 = unsafe.Pointer(&b[0])
  695. } else {
  696. _p0 = unsafe.Pointer(&_zero)
  697. }
  698. _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
  699. if e1 != 0 {
  700. err = errnoErr(e1)
  701. }
  702. return
  703. }
  704. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  705. func Munlockall() (err error) {
  706. _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
  707. if e1 != 0 {
  708. err = errnoErr(e1)
  709. }
  710. return
  711. }
  712. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  713. func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
  714. _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
  715. if e1 != 0 {
  716. err = errnoErr(e1)
  717. }
  718. return
  719. }
  720. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  721. func Open(path string, mode int, perm uint32) (fd int, err error) {
  722. var _p0 *byte
  723. _p0, err = BytePtrFromString(path)
  724. if err != nil {
  725. return
  726. }
  727. r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
  728. use(unsafe.Pointer(_p0))
  729. fd = int(r0)
  730. if e1 != 0 {
  731. err = errnoErr(e1)
  732. }
  733. return
  734. }
  735. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  736. func Pathconf(path string, name int) (val int, err error) {
  737. var _p0 *byte
  738. _p0, err = BytePtrFromString(path)
  739. if err != nil {
  740. return
  741. }
  742. r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
  743. use(unsafe.Pointer(_p0))
  744. val = int(r0)
  745. if e1 != 0 {
  746. err = errnoErr(e1)
  747. }
  748. return
  749. }
  750. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  751. func Pread(fd int, p []byte, offset int64) (n int, err error) {
  752. var _p0 unsafe.Pointer
  753. if len(p) > 0 {
  754. _p0 = unsafe.Pointer(&p[0])
  755. } else {
  756. _p0 = unsafe.Pointer(&_zero)
  757. }
  758. r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
  759. n = int(r0)
  760. if e1 != 0 {
  761. err = errnoErr(e1)
  762. }
  763. return
  764. }
  765. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  766. func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
  767. var _p0 unsafe.Pointer
  768. if len(p) > 0 {
  769. _p0 = unsafe.Pointer(&p[0])
  770. } else {
  771. _p0 = unsafe.Pointer(&_zero)
  772. }
  773. r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
  774. n = int(r0)
  775. if e1 != 0 {
  776. err = errnoErr(e1)
  777. }
  778. return
  779. }
  780. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  781. func read(fd int, p []byte) (n int, err error) {
  782. var _p0 unsafe.Pointer
  783. if len(p) > 0 {
  784. _p0 = unsafe.Pointer(&p[0])
  785. } else {
  786. _p0 = unsafe.Pointer(&_zero)
  787. }
  788. r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
  789. n = int(r0)
  790. if e1 != 0 {
  791. err = errnoErr(e1)
  792. }
  793. return
  794. }
  795. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  796. func Readlink(path string, buf []byte) (n int, err error) {
  797. var _p0 *byte
  798. _p0, err = BytePtrFromString(path)
  799. if err != nil {
  800. return
  801. }
  802. var _p1 unsafe.Pointer
  803. if len(buf) > 0 {
  804. _p1 = unsafe.Pointer(&buf[0])
  805. } else {
  806. _p1 = unsafe.Pointer(&_zero)
  807. }
  808. r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
  809. use(unsafe.Pointer(_p0))
  810. n = int(r0)
  811. if e1 != 0 {
  812. err = errnoErr(e1)
  813. }
  814. return
  815. }
  816. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  817. func Rename(from string, to string) (err error) {
  818. var _p0 *byte
  819. _p0, err = BytePtrFromString(from)
  820. if err != nil {
  821. return
  822. }
  823. var _p1 *byte
  824. _p1, err = BytePtrFromString(to)
  825. if err != nil {
  826. return
  827. }
  828. _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
  829. use(unsafe.Pointer(_p0))
  830. use(unsafe.Pointer(_p1))
  831. if e1 != 0 {
  832. err = errnoErr(e1)
  833. }
  834. return
  835. }
  836. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  837. func Revoke(path string) (err error) {
  838. var _p0 *byte
  839. _p0, err = BytePtrFromString(path)
  840. if err != nil {
  841. return
  842. }
  843. _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
  844. use(unsafe.Pointer(_p0))
  845. if e1 != 0 {
  846. err = errnoErr(e1)
  847. }
  848. return
  849. }
  850. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  851. func Rmdir(path string) (err error) {
  852. var _p0 *byte
  853. _p0, err = BytePtrFromString(path)
  854. if err != nil {
  855. return
  856. }
  857. _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
  858. use(unsafe.Pointer(_p0))
  859. if e1 != 0 {
  860. err = errnoErr(e1)
  861. }
  862. return
  863. }
  864. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  865. func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
  866. r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)
  867. newoffset = int64(int64(r1)<<32 | int64(r0))
  868. if e1 != 0 {
  869. err = errnoErr(e1)
  870. }
  871. return
  872. }
  873. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  874. func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
  875. _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
  876. if e1 != 0 {
  877. err = errnoErr(e1)
  878. }
  879. return
  880. }
  881. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  882. func Setegid(egid int) (err error) {
  883. _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
  884. if e1 != 0 {
  885. err = errnoErr(e1)
  886. }
  887. return
  888. }
  889. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  890. func Seteuid(euid int) (err error) {
  891. _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
  892. if e1 != 0 {
  893. err = errnoErr(e1)
  894. }
  895. return
  896. }
  897. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  898. func Setgid(gid int) (err error) {
  899. _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
  900. if e1 != 0 {
  901. err = errnoErr(e1)
  902. }
  903. return
  904. }
  905. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  906. func Setpgid(pid int, pgid int) (err error) {
  907. _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
  908. if e1 != 0 {
  909. err = errnoErr(e1)
  910. }
  911. return
  912. }
  913. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  914. func Setpriority(which int, who int, prio int) (err error) {
  915. _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
  916. if e1 != 0 {
  917. err = errnoErr(e1)
  918. }
  919. return
  920. }
  921. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  922. func Setregid(rgid int, egid int) (err error) {
  923. _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
  924. if e1 != 0 {
  925. err = errnoErr(e1)
  926. }
  927. return
  928. }
  929. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  930. func Setreuid(ruid int, euid int) (err error) {
  931. _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
  932. if e1 != 0 {
  933. err = errnoErr(e1)
  934. }
  935. return
  936. }
  937. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  938. func Setrlimit(which int, lim *Rlimit) (err error) {
  939. _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
  940. if e1 != 0 {
  941. err = errnoErr(e1)
  942. }
  943. return
  944. }
  945. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  946. func Setsid() (pid int, err error) {
  947. r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
  948. pid = int(r0)
  949. if e1 != 0 {
  950. err = errnoErr(e1)
  951. }
  952. return
  953. }
  954. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  955. func Settimeofday(tp *Timeval) (err error) {
  956. _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
  957. if e1 != 0 {
  958. err = errnoErr(e1)
  959. }
  960. return
  961. }
  962. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  963. func Setuid(uid int) (err error) {
  964. _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
  965. if e1 != 0 {
  966. err = errnoErr(e1)
  967. }
  968. return
  969. }
  970. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  971. func Stat(path string, stat *Stat_t) (err error) {
  972. var _p0 *byte
  973. _p0, err = BytePtrFromString(path)
  974. if err != nil {
  975. return
  976. }
  977. _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
  978. use(unsafe.Pointer(_p0))
  979. if e1 != 0 {
  980. err = errnoErr(e1)
  981. }
  982. return
  983. }
  984. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  985. func Symlink(path string, link string) (err error) {
  986. var _p0 *byte
  987. _p0, err = BytePtrFromString(path)
  988. if err != nil {
  989. return
  990. }
  991. var _p1 *byte
  992. _p1, err = BytePtrFromString(link)
  993. if err != nil {
  994. return
  995. }
  996. _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
  997. use(unsafe.Pointer(_p0))
  998. use(unsafe.Pointer(_p1))
  999. if e1 != 0 {
  1000. err = errnoErr(e1)
  1001. }
  1002. return
  1003. }
  1004. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1005. func Sync() (err error) {
  1006. _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
  1007. if e1 != 0 {
  1008. err = errnoErr(e1)
  1009. }
  1010. return
  1011. }
  1012. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1013. func Truncate(path string, length int64) (err error) {
  1014. var _p0 *byte
  1015. _p0, err = BytePtrFromString(path)
  1016. if err != nil {
  1017. return
  1018. }
  1019. _, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)
  1020. use(unsafe.Pointer(_p0))
  1021. if e1 != 0 {
  1022. err = errnoErr(e1)
  1023. }
  1024. return
  1025. }
  1026. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1027. func Umask(newmask int) (oldmask int) {
  1028. r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
  1029. oldmask = int(r0)
  1030. return
  1031. }
  1032. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1033. func Unlink(path string) (err error) {
  1034. var _p0 *byte
  1035. _p0, err = BytePtrFromString(path)
  1036. if err != nil {
  1037. return
  1038. }
  1039. _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
  1040. use(unsafe.Pointer(_p0))
  1041. if e1 != 0 {
  1042. err = errnoErr(e1)
  1043. }
  1044. return
  1045. }
  1046. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1047. func Unmount(path string, flags int) (err error) {
  1048. var _p0 *byte
  1049. _p0, err = BytePtrFromString(path)
  1050. if err != nil {
  1051. return
  1052. }
  1053. _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
  1054. use(unsafe.Pointer(_p0))
  1055. if e1 != 0 {
  1056. err = errnoErr(e1)
  1057. }
  1058. return
  1059. }
  1060. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1061. func write(fd int, p []byte) (n int, err error) {
  1062. var _p0 unsafe.Pointer
  1063. if len(p) > 0 {
  1064. _p0 = unsafe.Pointer(&p[0])
  1065. } else {
  1066. _p0 = unsafe.Pointer(&_zero)
  1067. }
  1068. r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
  1069. n = int(r0)
  1070. if e1 != 0 {
  1071. err = errnoErr(e1)
  1072. }
  1073. return
  1074. }
  1075. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1076. func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
  1077. r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)
  1078. ret = uintptr(r0)
  1079. if e1 != 0 {
  1080. err = errnoErr(e1)
  1081. }
  1082. return
  1083. }
  1084. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1085. func munmap(addr uintptr, length uintptr) (err error) {
  1086. _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
  1087. if e1 != 0 {
  1088. err = errnoErr(e1)
  1089. }
  1090. return
  1091. }
  1092. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1093. func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
  1094. r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
  1095. n = int(r0)
  1096. if e1 != 0 {
  1097. err = errnoErr(e1)
  1098. }
  1099. return
  1100. }
  1101. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1102. func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
  1103. r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
  1104. n = int(r0)
  1105. if e1 != 0 {
  1106. err = errnoErr(e1)
  1107. }
  1108. return
  1109. }