zsyscall_openbsd_386.go 32 KB

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