zsyscall_darwin_amd64.go 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443
  1. // mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go
  2. // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  3. // +build amd64,darwin
  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 ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
  221. _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
  222. if e1 != 0 {
  223. err = errnoErr(e1)
  224. }
  225. return
  226. }
  227. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  228. func pipe() (r int, w int, err error) {
  229. r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
  230. r = int(r0)
  231. w = int(r1)
  232. if e1 != 0 {
  233. err = errnoErr(e1)
  234. }
  235. return
  236. }
  237. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  238. func kill(pid int, signum int, posix int) (err error) {
  239. _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
  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 Exchangedata(path1 string, path2 string, options int) (err error) {
  364. var _p0 *byte
  365. _p0, err = BytePtrFromString(path1)
  366. if err != nil {
  367. return
  368. }
  369. var _p1 *byte
  370. _p1, err = BytePtrFromString(path2)
  371. if err != nil {
  372. return
  373. }
  374. _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
  375. use(unsafe.Pointer(_p0))
  376. use(unsafe.Pointer(_p1))
  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 Exit(code int) {
  384. Syscall(SYS_EXIT, uintptr(code), 0, 0)
  385. return
  386. }
  387. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  388. func Fchdir(fd int) (err error) {
  389. _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
  390. if e1 != 0 {
  391. err = errnoErr(e1)
  392. }
  393. return
  394. }
  395. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  396. func Fchflags(fd int, flags int) (err error) {
  397. _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
  398. if e1 != 0 {
  399. err = errnoErr(e1)
  400. }
  401. return
  402. }
  403. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  404. func Fchmod(fd int, mode uint32) (err error) {
  405. _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
  406. if e1 != 0 {
  407. err = errnoErr(e1)
  408. }
  409. return
  410. }
  411. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  412. func Fchown(fd int, uid int, gid int) (err error) {
  413. _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
  414. if e1 != 0 {
  415. err = errnoErr(e1)
  416. }
  417. return
  418. }
  419. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  420. func Flock(fd int, how int) (err error) {
  421. _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
  422. if e1 != 0 {
  423. err = errnoErr(e1)
  424. }
  425. return
  426. }
  427. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  428. func Fpathconf(fd int, name int) (val int, err error) {
  429. r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
  430. val = int(r0)
  431. if e1 != 0 {
  432. err = errnoErr(e1)
  433. }
  434. return
  435. }
  436. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  437. func Fstat(fd int, stat *Stat_t) (err error) {
  438. _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
  439. if e1 != 0 {
  440. err = errnoErr(e1)
  441. }
  442. return
  443. }
  444. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  445. func Fstatfs(fd int, stat *Statfs_t) (err error) {
  446. _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
  447. if e1 != 0 {
  448. err = errnoErr(e1)
  449. }
  450. return
  451. }
  452. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  453. func Fsync(fd int) (err error) {
  454. _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
  455. if e1 != 0 {
  456. err = errnoErr(e1)
  457. }
  458. return
  459. }
  460. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  461. func Ftruncate(fd int, length int64) (err error) {
  462. _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
  463. if e1 != 0 {
  464. err = errnoErr(e1)
  465. }
  466. return
  467. }
  468. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  469. func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
  470. var _p0 unsafe.Pointer
  471. if len(buf) > 0 {
  472. _p0 = unsafe.Pointer(&buf[0])
  473. } else {
  474. _p0 = unsafe.Pointer(&_zero)
  475. }
  476. r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
  477. n = int(r0)
  478. if e1 != 0 {
  479. err = errnoErr(e1)
  480. }
  481. return
  482. }
  483. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  484. func Getdtablesize() (size int) {
  485. r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)
  486. size = int(r0)
  487. return
  488. }
  489. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  490. func Getegid() (egid int) {
  491. r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
  492. egid = int(r0)
  493. return
  494. }
  495. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  496. func Geteuid() (uid int) {
  497. r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
  498. uid = int(r0)
  499. return
  500. }
  501. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  502. func Getgid() (gid int) {
  503. r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
  504. gid = int(r0)
  505. return
  506. }
  507. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  508. func Getpgid(pid int) (pgid int, err error) {
  509. r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
  510. pgid = int(r0)
  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 Getpgrp() (pgrp int) {
  518. r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
  519. pgrp = int(r0)
  520. return
  521. }
  522. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  523. func Getpid() (pid int) {
  524. r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
  525. pid = int(r0)
  526. return
  527. }
  528. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  529. func Getppid() (ppid int) {
  530. r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
  531. ppid = int(r0)
  532. return
  533. }
  534. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  535. func Getpriority(which int, who int) (prio int, err error) {
  536. r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
  537. prio = int(r0)
  538. if e1 != 0 {
  539. err = errnoErr(e1)
  540. }
  541. return
  542. }
  543. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  544. func Getrlimit(which int, lim *Rlimit) (err error) {
  545. _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
  546. if e1 != 0 {
  547. err = errnoErr(e1)
  548. }
  549. return
  550. }
  551. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  552. func Getrusage(who int, rusage *Rusage) (err error) {
  553. _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
  554. if e1 != 0 {
  555. err = errnoErr(e1)
  556. }
  557. return
  558. }
  559. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  560. func Getsid(pid int) (sid int, err error) {
  561. r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
  562. sid = int(r0)
  563. if e1 != 0 {
  564. err = errnoErr(e1)
  565. }
  566. return
  567. }
  568. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  569. func Getuid() (uid int) {
  570. r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
  571. uid = int(r0)
  572. return
  573. }
  574. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  575. func Issetugid() (tainted bool) {
  576. r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)
  577. tainted = bool(r0 != 0)
  578. return
  579. }
  580. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  581. func Kqueue() (fd int, err error) {
  582. r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
  583. fd = int(r0)
  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 Lchown(path string, uid int, gid int) (err error) {
  591. var _p0 *byte
  592. _p0, err = BytePtrFromString(path)
  593. if err != nil {
  594. return
  595. }
  596. _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
  597. use(unsafe.Pointer(_p0))
  598. if e1 != 0 {
  599. err = errnoErr(e1)
  600. }
  601. return
  602. }
  603. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  604. func Link(path string, link string) (err error) {
  605. var _p0 *byte
  606. _p0, err = BytePtrFromString(path)
  607. if err != nil {
  608. return
  609. }
  610. var _p1 *byte
  611. _p1, err = BytePtrFromString(link)
  612. if err != nil {
  613. return
  614. }
  615. _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
  616. use(unsafe.Pointer(_p0))
  617. use(unsafe.Pointer(_p1))
  618. if e1 != 0 {
  619. err = errnoErr(e1)
  620. }
  621. return
  622. }
  623. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  624. func Listen(s int, backlog int) (err error) {
  625. _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
  626. if e1 != 0 {
  627. err = errnoErr(e1)
  628. }
  629. return
  630. }
  631. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  632. func Lstat(path string, stat *Stat_t) (err error) {
  633. var _p0 *byte
  634. _p0, err = BytePtrFromString(path)
  635. if err != nil {
  636. return
  637. }
  638. _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
  639. use(unsafe.Pointer(_p0))
  640. if e1 != 0 {
  641. err = errnoErr(e1)
  642. }
  643. return
  644. }
  645. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  646. func Mkdir(path string, mode uint32) (err error) {
  647. var _p0 *byte
  648. _p0, err = BytePtrFromString(path)
  649. if err != nil {
  650. return
  651. }
  652. _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
  653. use(unsafe.Pointer(_p0))
  654. if e1 != 0 {
  655. err = errnoErr(e1)
  656. }
  657. return
  658. }
  659. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  660. func Mkfifo(path string, mode uint32) (err error) {
  661. var _p0 *byte
  662. _p0, err = BytePtrFromString(path)
  663. if err != nil {
  664. return
  665. }
  666. _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
  667. use(unsafe.Pointer(_p0))
  668. if e1 != 0 {
  669. err = errnoErr(e1)
  670. }
  671. return
  672. }
  673. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  674. func Mknod(path string, mode uint32, dev int) (err error) {
  675. var _p0 *byte
  676. _p0, err = BytePtrFromString(path)
  677. if err != nil {
  678. return
  679. }
  680. _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
  681. use(unsafe.Pointer(_p0))
  682. if e1 != 0 {
  683. err = errnoErr(e1)
  684. }
  685. return
  686. }
  687. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  688. func Mlock(b []byte) (err error) {
  689. var _p0 unsafe.Pointer
  690. if len(b) > 0 {
  691. _p0 = unsafe.Pointer(&b[0])
  692. } else {
  693. _p0 = unsafe.Pointer(&_zero)
  694. }
  695. _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
  696. if e1 != 0 {
  697. err = errnoErr(e1)
  698. }
  699. return
  700. }
  701. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  702. func Mlockall(flags int) (err error) {
  703. _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
  704. if e1 != 0 {
  705. err = errnoErr(e1)
  706. }
  707. return
  708. }
  709. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  710. func Mprotect(b []byte, prot int) (err error) {
  711. var _p0 unsafe.Pointer
  712. if len(b) > 0 {
  713. _p0 = unsafe.Pointer(&b[0])
  714. } else {
  715. _p0 = unsafe.Pointer(&_zero)
  716. }
  717. _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
  718. if e1 != 0 {
  719. err = errnoErr(e1)
  720. }
  721. return
  722. }
  723. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  724. func Munlock(b []byte) (err error) {
  725. var _p0 unsafe.Pointer
  726. if len(b) > 0 {
  727. _p0 = unsafe.Pointer(&b[0])
  728. } else {
  729. _p0 = unsafe.Pointer(&_zero)
  730. }
  731. _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
  732. if e1 != 0 {
  733. err = errnoErr(e1)
  734. }
  735. return
  736. }
  737. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  738. func Munlockall() (err error) {
  739. _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
  740. if e1 != 0 {
  741. err = errnoErr(e1)
  742. }
  743. return
  744. }
  745. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  746. func Open(path string, mode int, perm uint32) (fd int, err error) {
  747. var _p0 *byte
  748. _p0, err = BytePtrFromString(path)
  749. if err != nil {
  750. return
  751. }
  752. r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
  753. use(unsafe.Pointer(_p0))
  754. fd = int(r0)
  755. if e1 != 0 {
  756. err = errnoErr(e1)
  757. }
  758. return
  759. }
  760. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  761. func Pathconf(path string, name int) (val int, err error) {
  762. var _p0 *byte
  763. _p0, err = BytePtrFromString(path)
  764. if err != nil {
  765. return
  766. }
  767. r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
  768. use(unsafe.Pointer(_p0))
  769. val = int(r0)
  770. if e1 != 0 {
  771. err = errnoErr(e1)
  772. }
  773. return
  774. }
  775. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  776. func Pread(fd int, p []byte, offset int64) (n int, err error) {
  777. var _p0 unsafe.Pointer
  778. if len(p) > 0 {
  779. _p0 = unsafe.Pointer(&p[0])
  780. } else {
  781. _p0 = unsafe.Pointer(&_zero)
  782. }
  783. r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
  784. n = int(r0)
  785. if e1 != 0 {
  786. err = errnoErr(e1)
  787. }
  788. return
  789. }
  790. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  791. func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
  792. var _p0 unsafe.Pointer
  793. if len(p) > 0 {
  794. _p0 = unsafe.Pointer(&p[0])
  795. } else {
  796. _p0 = unsafe.Pointer(&_zero)
  797. }
  798. r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
  799. n = int(r0)
  800. if e1 != 0 {
  801. err = errnoErr(e1)
  802. }
  803. return
  804. }
  805. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  806. func read(fd int, p []byte) (n int, err error) {
  807. var _p0 unsafe.Pointer
  808. if len(p) > 0 {
  809. _p0 = unsafe.Pointer(&p[0])
  810. } else {
  811. _p0 = unsafe.Pointer(&_zero)
  812. }
  813. r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
  814. n = int(r0)
  815. if e1 != 0 {
  816. err = errnoErr(e1)
  817. }
  818. return
  819. }
  820. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  821. func Readlink(path string, buf []byte) (n int, err error) {
  822. var _p0 *byte
  823. _p0, err = BytePtrFromString(path)
  824. if err != nil {
  825. return
  826. }
  827. var _p1 unsafe.Pointer
  828. if len(buf) > 0 {
  829. _p1 = unsafe.Pointer(&buf[0])
  830. } else {
  831. _p1 = unsafe.Pointer(&_zero)
  832. }
  833. r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
  834. use(unsafe.Pointer(_p0))
  835. n = int(r0)
  836. if e1 != 0 {
  837. err = errnoErr(e1)
  838. }
  839. return
  840. }
  841. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  842. func Rename(from string, to string) (err error) {
  843. var _p0 *byte
  844. _p0, err = BytePtrFromString(from)
  845. if err != nil {
  846. return
  847. }
  848. var _p1 *byte
  849. _p1, err = BytePtrFromString(to)
  850. if err != nil {
  851. return
  852. }
  853. _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
  854. use(unsafe.Pointer(_p0))
  855. use(unsafe.Pointer(_p1))
  856. if e1 != 0 {
  857. err = errnoErr(e1)
  858. }
  859. return
  860. }
  861. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  862. func Revoke(path string) (err error) {
  863. var _p0 *byte
  864. _p0, err = BytePtrFromString(path)
  865. if err != nil {
  866. return
  867. }
  868. _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
  869. use(unsafe.Pointer(_p0))
  870. if e1 != 0 {
  871. err = errnoErr(e1)
  872. }
  873. return
  874. }
  875. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  876. func Rmdir(path string) (err error) {
  877. var _p0 *byte
  878. _p0, err = BytePtrFromString(path)
  879. if err != nil {
  880. return
  881. }
  882. _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
  883. use(unsafe.Pointer(_p0))
  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 Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
  891. r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
  892. newoffset = int64(r0)
  893. if e1 != 0 {
  894. err = errnoErr(e1)
  895. }
  896. return
  897. }
  898. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  899. func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
  900. _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
  901. if e1 != 0 {
  902. err = errnoErr(e1)
  903. }
  904. return
  905. }
  906. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  907. func Setegid(egid int) (err error) {
  908. _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)
  909. if e1 != 0 {
  910. err = errnoErr(e1)
  911. }
  912. return
  913. }
  914. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  915. func Seteuid(euid int) (err error) {
  916. _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
  917. if e1 != 0 {
  918. err = errnoErr(e1)
  919. }
  920. return
  921. }
  922. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  923. func Setgid(gid int) (err error) {
  924. _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
  925. if e1 != 0 {
  926. err = errnoErr(e1)
  927. }
  928. return
  929. }
  930. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  931. func Setlogin(name string) (err error) {
  932. var _p0 *byte
  933. _p0, err = BytePtrFromString(name)
  934. if err != nil {
  935. return
  936. }
  937. _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
  938. use(unsafe.Pointer(_p0))
  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 Setpgid(pid int, pgid int) (err error) {
  946. _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
  947. if e1 != 0 {
  948. err = errnoErr(e1)
  949. }
  950. return
  951. }
  952. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  953. func Setpriority(which int, who int, prio int) (err error) {
  954. _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
  955. if e1 != 0 {
  956. err = errnoErr(e1)
  957. }
  958. return
  959. }
  960. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  961. func Setprivexec(flag int) (err error) {
  962. _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)
  963. if e1 != 0 {
  964. err = errnoErr(e1)
  965. }
  966. return
  967. }
  968. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  969. func Setregid(rgid int, egid int) (err error) {
  970. _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
  971. if e1 != 0 {
  972. err = errnoErr(e1)
  973. }
  974. return
  975. }
  976. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  977. func Setreuid(ruid int, euid int) (err error) {
  978. _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
  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 Setrlimit(which int, lim *Rlimit) (err error) {
  986. _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
  987. if e1 != 0 {
  988. err = errnoErr(e1)
  989. }
  990. return
  991. }
  992. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  993. func Setsid() (pid int, err error) {
  994. r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
  995. pid = int(r0)
  996. if e1 != 0 {
  997. err = errnoErr(e1)
  998. }
  999. return
  1000. }
  1001. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1002. func Settimeofday(tp *Timeval) (err error) {
  1003. _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
  1004. if e1 != 0 {
  1005. err = errnoErr(e1)
  1006. }
  1007. return
  1008. }
  1009. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1010. func Setuid(uid int) (err error) {
  1011. _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
  1012. if e1 != 0 {
  1013. err = errnoErr(e1)
  1014. }
  1015. return
  1016. }
  1017. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1018. func Stat(path string, stat *Stat_t) (err error) {
  1019. var _p0 *byte
  1020. _p0, err = BytePtrFromString(path)
  1021. if err != nil {
  1022. return
  1023. }
  1024. _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
  1025. use(unsafe.Pointer(_p0))
  1026. if e1 != 0 {
  1027. err = errnoErr(e1)
  1028. }
  1029. return
  1030. }
  1031. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1032. func Statfs(path string, stat *Statfs_t) (err error) {
  1033. var _p0 *byte
  1034. _p0, err = BytePtrFromString(path)
  1035. if err != nil {
  1036. return
  1037. }
  1038. _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 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 Symlink(path string, link string) (err error) {
  1047. var _p0 *byte
  1048. _p0, err = BytePtrFromString(path)
  1049. if err != nil {
  1050. return
  1051. }
  1052. var _p1 *byte
  1053. _p1, err = BytePtrFromString(link)
  1054. if err != nil {
  1055. return
  1056. }
  1057. _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
  1058. use(unsafe.Pointer(_p0))
  1059. use(unsafe.Pointer(_p1))
  1060. if e1 != 0 {
  1061. err = errnoErr(e1)
  1062. }
  1063. return
  1064. }
  1065. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1066. func Sync() (err error) {
  1067. _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
  1068. if e1 != 0 {
  1069. err = errnoErr(e1)
  1070. }
  1071. return
  1072. }
  1073. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1074. func Truncate(path string, length int64) (err error) {
  1075. var _p0 *byte
  1076. _p0, err = BytePtrFromString(path)
  1077. if err != nil {
  1078. return
  1079. }
  1080. _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
  1081. use(unsafe.Pointer(_p0))
  1082. if e1 != 0 {
  1083. err = errnoErr(e1)
  1084. }
  1085. return
  1086. }
  1087. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1088. func Umask(newmask int) (oldmask int) {
  1089. r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
  1090. oldmask = int(r0)
  1091. return
  1092. }
  1093. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1094. func Undelete(path string) (err error) {
  1095. var _p0 *byte
  1096. _p0, err = BytePtrFromString(path)
  1097. if err != nil {
  1098. return
  1099. }
  1100. _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
  1101. use(unsafe.Pointer(_p0))
  1102. if e1 != 0 {
  1103. err = errnoErr(e1)
  1104. }
  1105. return
  1106. }
  1107. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1108. func Unlink(path string) (err error) {
  1109. var _p0 *byte
  1110. _p0, err = BytePtrFromString(path)
  1111. if err != nil {
  1112. return
  1113. }
  1114. _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
  1115. use(unsafe.Pointer(_p0))
  1116. if e1 != 0 {
  1117. err = errnoErr(e1)
  1118. }
  1119. return
  1120. }
  1121. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1122. func Unmount(path string, flags int) (err error) {
  1123. var _p0 *byte
  1124. _p0, err = BytePtrFromString(path)
  1125. if err != nil {
  1126. return
  1127. }
  1128. _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
  1129. use(unsafe.Pointer(_p0))
  1130. if e1 != 0 {
  1131. err = errnoErr(e1)
  1132. }
  1133. return
  1134. }
  1135. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1136. func write(fd int, p []byte) (n int, err error) {
  1137. var _p0 unsafe.Pointer
  1138. if len(p) > 0 {
  1139. _p0 = unsafe.Pointer(&p[0])
  1140. } else {
  1141. _p0 = unsafe.Pointer(&_zero)
  1142. }
  1143. r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
  1144. n = int(r0)
  1145. if e1 != 0 {
  1146. err = errnoErr(e1)
  1147. }
  1148. return
  1149. }
  1150. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1151. func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
  1152. r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
  1153. ret = uintptr(r0)
  1154. if e1 != 0 {
  1155. err = errnoErr(e1)
  1156. }
  1157. return
  1158. }
  1159. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1160. func munmap(addr uintptr, length uintptr) (err error) {
  1161. _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
  1162. if e1 != 0 {
  1163. err = errnoErr(e1)
  1164. }
  1165. return
  1166. }
  1167. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1168. func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
  1169. r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
  1170. n = int(r0)
  1171. if e1 != 0 {
  1172. err = errnoErr(e1)
  1173. }
  1174. return
  1175. }
  1176. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1177. func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
  1178. r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
  1179. n = int(r0)
  1180. if e1 != 0 {
  1181. err = errnoErr(e1)
  1182. }
  1183. return
  1184. }
  1185. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1186. func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
  1187. var _p0 *byte
  1188. _p0, err = BytePtrFromString(path)
  1189. if err != nil {
  1190. return
  1191. }
  1192. _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
  1193. use(unsafe.Pointer(_p0))
  1194. if e1 != 0 {
  1195. err = errnoErr(e1)
  1196. }
  1197. return
  1198. }
  1199. // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
  1200. func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {
  1201. r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
  1202. sec = int64(r0)
  1203. usec = int32(r1)
  1204. if e1 != 0 {
  1205. err = errnoErr(e1)
  1206. }
  1207. return
  1208. }