zsyscall_netbsd_amd64.go 31 KB

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