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