You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1563 lines
41 KiB

  1. // mksyscall_solaris.pl -tags solaris,amd64 syscall_solaris.go syscall_solaris_amd64.go
  2. // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  3. // +build solaris,amd64
  4. package unix
  5. import (
  6. "syscall"
  7. "unsafe"
  8. )
  9. //go:cgo_import_dynamic libc_pipe pipe "libc.so"
  10. //go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so"
  11. //go:cgo_import_dynamic libc_getcwd getcwd "libc.so"
  12. //go:cgo_import_dynamic libc_getgroups getgroups "libc.so"
  13. //go:cgo_import_dynamic libc_setgroups setgroups "libc.so"
  14. //go:cgo_import_dynamic libc_wait4 wait4 "libc.so"
  15. //go:cgo_import_dynamic libc_gethostname gethostname "libc.so"
  16. //go:cgo_import_dynamic libc_utimes utimes "libc.so"
  17. //go:cgo_import_dynamic libc_utimensat utimensat "libc.so"
  18. //go:cgo_import_dynamic libc_fcntl fcntl "libc.so"
  19. //go:cgo_import_dynamic libc_futimesat futimesat "libc.so"
  20. //go:cgo_import_dynamic libc_accept accept "libsocket.so"
  21. //go:cgo_import_dynamic libc_recvmsg recvmsg "libsocket.so"
  22. //go:cgo_import_dynamic libc_sendmsg sendmsg "libsocket.so"
  23. //go:cgo_import_dynamic libc_acct acct "libc.so"
  24. //go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
  25. //go:cgo_import_dynamic libc_access access "libc.so"
  26. //go:cgo_import_dynamic libc_adjtime adjtime "libc.so"
  27. //go:cgo_import_dynamic libc_chdir chdir "libc.so"
  28. //go:cgo_import_dynamic libc_chmod chmod "libc.so"
  29. //go:cgo_import_dynamic libc_chown chown "libc.so"
  30. //go:cgo_import_dynamic libc_chroot chroot "libc.so"
  31. //go:cgo_import_dynamic libc_close close "libc.so"
  32. //go:cgo_import_dynamic libc_creat creat "libc.so"
  33. //go:cgo_import_dynamic libc_dup dup "libc.so"
  34. //go:cgo_import_dynamic libc_dup2 dup2 "libc.so"
  35. //go:cgo_import_dynamic libc_exit exit "libc.so"
  36. //go:cgo_import_dynamic libc_fchdir fchdir "libc.so"
  37. //go:cgo_import_dynamic libc_fchmod fchmod "libc.so"
  38. //go:cgo_import_dynamic libc_fchmodat fchmodat "libc.so"
  39. //go:cgo_import_dynamic libc_fchown fchown "libc.so"
  40. //go:cgo_import_dynamic libc_fchownat fchownat "libc.so"
  41. //go:cgo_import_dynamic libc_fdatasync fdatasync "libc.so"
  42. //go:cgo_import_dynamic libc_fpathconf fpathconf "libc.so"
  43. //go:cgo_import_dynamic libc_fstat fstat "libc.so"
  44. //go:cgo_import_dynamic libc_getdents getdents "libc.so"
  45. //go:cgo_import_dynamic libc_getgid getgid "libc.so"
  46. //go:cgo_import_dynamic libc_getpid getpid "libc.so"
  47. //go:cgo_import_dynamic libc_getpgid getpgid "libc.so"
  48. //go:cgo_import_dynamic libc_getpgrp getpgrp "libc.so"
  49. //go:cgo_import_dynamic libc_geteuid geteuid "libc.so"
  50. //go:cgo_import_dynamic libc_getegid getegid "libc.so"
  51. //go:cgo_import_dynamic libc_getppid getppid "libc.so"
  52. //go:cgo_import_dynamic libc_getpriority getpriority "libc.so"
  53. //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so"
  54. //go:cgo_import_dynamic libc_getrusage getrusage "libc.so"
  55. //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so"
  56. //go:cgo_import_dynamic libc_getuid getuid "libc.so"
  57. //go:cgo_import_dynamic libc_kill kill "libc.so"
  58. //go:cgo_import_dynamic libc_lchown lchown "libc.so"
  59. //go:cgo_import_dynamic libc_link link "libc.so"
  60. //go:cgo_import_dynamic libc_listen listen "libsocket.so"
  61. //go:cgo_import_dynamic libc_lstat lstat "libc.so"
  62. //go:cgo_import_dynamic libc_madvise madvise "libc.so"
  63. //go:cgo_import_dynamic libc_mkdir mkdir "libc.so"
  64. //go:cgo_import_dynamic libc_mkdirat mkdirat "libc.so"
  65. //go:cgo_import_dynamic libc_mkfifo mkfifo "libc.so"
  66. //go:cgo_import_dynamic libc_mkfifoat mkfifoat "libc.so"
  67. //go:cgo_import_dynamic libc_mknod mknod "libc.so"
  68. //go:cgo_import_dynamic libc_mknodat mknodat "libc.so"
  69. //go:cgo_import_dynamic libc_mlock mlock "libc.so"
  70. //go:cgo_import_dynamic libc_mlockall mlockall "libc.so"
  71. //go:cgo_import_dynamic libc_mprotect mprotect "libc.so"
  72. //go:cgo_import_dynamic libc_munlock munlock "libc.so"
  73. //go:cgo_import_dynamic libc_munlockall munlockall "libc.so"
  74. //go:cgo_import_dynamic libc_nanosleep nanosleep "libc.so"
  75. //go:cgo_import_dynamic libc_open open "libc.so"
  76. //go:cgo_import_dynamic libc_openat openat "libc.so"
  77. //go:cgo_import_dynamic libc_pathconf pathconf "libc.so"
  78. //go:cgo_import_dynamic libc_pause pause "libc.so"
  79. //go:cgo_import_dynamic libc_pread pread "libc.so"
  80. //go:cgo_import_dynamic libc_pwrite pwrite "libc.so"
  81. //go:cgo_import_dynamic libc_read read "libc.so"
  82. //go:cgo_import_dynamic libc_readlink readlink "libc.so"
  83. //go:cgo_import_dynamic libc_rename rename "libc.so"
  84. //go:cgo_import_dynamic libc_renameat renameat "libc.so"
  85. //go:cgo_import_dynamic libc_rmdir rmdir "libc.so"
  86. //go:cgo_import_dynamic libc_lseek lseek "libc.so"
  87. //go:cgo_import_dynamic libc_setegid setegid "libc.so"
  88. //go:cgo_import_dynamic libc_seteuid seteuid "libc.so"
  89. //go:cgo_import_dynamic libc_setgid setgid "libc.so"
  90. //go:cgo_import_dynamic libc_sethostname sethostname "libc.so"
  91. //go:cgo_import_dynamic libc_setpgid setpgid "libc.so"
  92. //go:cgo_import_dynamic libc_setpriority setpriority "libc.so"
  93. //go:cgo_import_dynamic libc_setregid setregid "libc.so"
  94. //go:cgo_import_dynamic libc_setreuid setreuid "libc.so"
  95. //go:cgo_import_dynamic libc_setrlimit setrlimit "libc.so"
  96. //go:cgo_import_dynamic libc_setsid setsid "libc.so"
  97. //go:cgo_import_dynamic libc_setuid setuid "libc.so"
  98. //go:cgo_import_dynamic libc_shutdown shutdown "libsocket.so"
  99. //go:cgo_import_dynamic libc_stat stat "libc.so"
  100. //go:cgo_import_dynamic libc_symlink symlink "libc.so"
  101. //go:cgo_import_dynamic libc_sync sync "libc.so"
  102. //go:cgo_import_dynamic libc_times times "libc.so"
  103. //go:cgo_import_dynamic libc_truncate truncate "libc.so"
  104. //go:cgo_import_dynamic libc_fsync fsync "libc.so"
  105. //go:cgo_import_dynamic libc_ftruncate ftruncate "libc.so"
  106. //go:cgo_import_dynamic libc_umask umask "libc.so"
  107. //go:cgo_import_dynamic libc_uname uname "libc.so"
  108. //go:cgo_import_dynamic libc_umount umount "libc.so"
  109. //go:cgo_import_dynamic libc_unlink unlink "libc.so"
  110. //go:cgo_import_dynamic libc_unlinkat unlinkat "libc.so"
  111. //go:cgo_import_dynamic libc_ustat ustat "libc.so"
  112. //go:cgo_import_dynamic libc_utime utime "libc.so"
  113. //go:cgo_import_dynamic libc_bind bind "libsocket.so"
  114. //go:cgo_import_dynamic libc_connect connect "libsocket.so"
  115. //go:cgo_import_dynamic libc_mmap mmap "libc.so"
  116. //go:cgo_import_dynamic libc_munmap munmap "libc.so"
  117. //go:cgo_import_dynamic libc_sendto sendto "libsocket.so"
  118. //go:cgo_import_dynamic libc_socket socket "libsocket.so"
  119. //go:cgo_import_dynamic libc_socketpair socketpair "libsocket.so"
  120. //go:cgo_import_dynamic libc_write write "libc.so"
  121. //go:cgo_import_dynamic libc_getsockopt getsockopt "libsocket.so"
  122. //go:cgo_import_dynamic libc_getpeername getpeername "libsocket.so"
  123. //go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so"
  124. //go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so"
  125. //go:cgo_import_dynamic libc_sysconf sysconf "libc.so"
  126. //go:linkname procpipe libc_pipe
  127. //go:linkname procgetsockname libc_getsockname
  128. //go:linkname procGetcwd libc_getcwd
  129. //go:linkname procgetgroups libc_getgroups
  130. //go:linkname procsetgroups libc_setgroups
  131. //go:linkname procwait4 libc_wait4
  132. //go:linkname procgethostname libc_gethostname
  133. //go:linkname procutimes libc_utimes
  134. //go:linkname procutimensat libc_utimensat
  135. //go:linkname procfcntl libc_fcntl
  136. //go:linkname procfutimesat libc_futimesat
  137. //go:linkname procaccept libc_accept
  138. //go:linkname procrecvmsg libc_recvmsg
  139. //go:linkname procsendmsg libc_sendmsg
  140. //go:linkname procacct libc_acct
  141. //go:linkname procioctl libc_ioctl
  142. //go:linkname procAccess libc_access
  143. //go:linkname procAdjtime libc_adjtime
  144. //go:linkname procChdir libc_chdir
  145. //go:linkname procChmod libc_chmod
  146. //go:linkname procChown libc_chown
  147. //go:linkname procChroot libc_chroot
  148. //go:linkname procClose libc_close
  149. //go:linkname procCreat libc_creat
  150. //go:linkname procDup libc_dup
  151. //go:linkname procDup2 libc_dup2
  152. //go:linkname procExit libc_exit
  153. //go:linkname procFchdir libc_fchdir
  154. //go:linkname procFchmod libc_fchmod
  155. //go:linkname procFchmodat libc_fchmodat
  156. //go:linkname procFchown libc_fchown
  157. //go:linkname procFchownat libc_fchownat
  158. //go:linkname procFdatasync libc_fdatasync
  159. //go:linkname procFpathconf libc_fpathconf
  160. //go:linkname procFstat libc_fstat
  161. //go:linkname procGetdents libc_getdents
  162. //go:linkname procGetgid libc_getgid
  163. //go:linkname procGetpid libc_getpid
  164. //go:linkname procGetpgid libc_getpgid
  165. //go:linkname procGetpgrp libc_getpgrp
  166. //go:linkname procGeteuid libc_geteuid
  167. //go:linkname procGetegid libc_getegid
  168. //go:linkname procGetppid libc_getppid
  169. //go:linkname procGetpriority libc_getpriority
  170. //go:linkname procGetrlimit libc_getrlimit
  171. //go:linkname procGetrusage libc_getrusage
  172. //go:linkname procGettimeofday libc_gettimeofday
  173. //go:linkname procGetuid libc_getuid
  174. //go:linkname procKill libc_kill
  175. //go:linkname procLchown libc_lchown
  176. //go:linkname procLink libc_link
  177. //go:linkname proclisten libc_listen
  178. //go:linkname procLstat libc_lstat
  179. //go:linkname procMadvise libc_madvise
  180. //go:linkname procMkdir libc_mkdir
  181. //go:linkname procMkdirat libc_mkdirat
  182. //go:linkname procMkfifo libc_mkfifo
  183. //go:linkname procMkfifoat libc_mkfifoat
  184. //go:linkname procMknod libc_mknod
  185. //go:linkname procMknodat libc_mknodat
  186. //go:linkname procMlock libc_mlock
  187. //go:linkname procMlockall libc_mlockall
  188. //go:linkname procMprotect libc_mprotect
  189. //go:linkname procMunlock libc_munlock
  190. //go:linkname procMunlockall libc_munlockall
  191. //go:linkname procNanosleep libc_nanosleep
  192. //go:linkname procOpen libc_open
  193. //go:linkname procOpenat libc_openat
  194. //go:linkname procPathconf libc_pathconf
  195. //go:linkname procPause libc_pause
  196. //go:linkname procPread libc_pread
  197. //go:linkname procPwrite libc_pwrite
  198. //go:linkname procread libc_read
  199. //go:linkname procReadlink libc_readlink
  200. //go:linkname procRename libc_rename
  201. //go:linkname procRenameat libc_renameat
  202. //go:linkname procRmdir libc_rmdir
  203. //go:linkname proclseek libc_lseek
  204. //go:linkname procSetegid libc_setegid
  205. //go:linkname procSeteuid libc_seteuid
  206. //go:linkname procSetgid libc_setgid
  207. //go:linkname procSethostname libc_sethostname
  208. //go:linkname procSetpgid libc_setpgid
  209. //go:linkname procSetpriority libc_setpriority
  210. //go:linkname procSetregid libc_setregid
  211. //go:linkname procSetreuid libc_setreuid
  212. //go:linkname procSetrlimit libc_setrlimit
  213. //go:linkname procSetsid libc_setsid
  214. //go:linkname procSetuid libc_setuid
  215. //go:linkname procshutdown libc_shutdown
  216. //go:linkname procStat libc_stat
  217. //go:linkname procSymlink libc_symlink
  218. //go:linkname procSync libc_sync
  219. //go:linkname procTimes libc_times
  220. //go:linkname procTruncate libc_truncate
  221. //go:linkname procFsync libc_fsync
  222. //go:linkname procFtruncate libc_ftruncate
  223. //go:linkname procUmask libc_umask
  224. //go:linkname procUname libc_uname
  225. //go:linkname procumount libc_umount
  226. //go:linkname procUnlink libc_unlink
  227. //go:linkname procUnlinkat libc_unlinkat
  228. //go:linkname procUstat libc_ustat
  229. //go:linkname procUtime libc_utime
  230. //go:linkname procbind libc_bind
  231. //go:linkname procconnect libc_connect
  232. //go:linkname procmmap libc_mmap
  233. //go:linkname procmunmap libc_munmap
  234. //go:linkname procsendto libc_sendto
  235. //go:linkname procsocket libc_socket
  236. //go:linkname procsocketpair libc_socketpair
  237. //go:linkname procwrite libc_write
  238. //go:linkname procgetsockopt libc_getsockopt
  239. //go:linkname procgetpeername libc_getpeername
  240. //go:linkname procsetsockopt libc_setsockopt
  241. //go:linkname procrecvfrom libc_recvfrom
  242. //go:linkname procsysconf libc_sysconf
  243. var (
  244. procpipe,
  245. procgetsockname,
  246. procGetcwd,
  247. procgetgroups,
  248. procsetgroups,
  249. procwait4,
  250. procgethostname,
  251. procutimes,
  252. procutimensat,
  253. procfcntl,
  254. procfutimesat,
  255. procaccept,
  256. procrecvmsg,
  257. procsendmsg,
  258. procacct,
  259. procioctl,
  260. procAccess,
  261. procAdjtime,
  262. procChdir,
  263. procChmod,
  264. procChown,
  265. procChroot,
  266. procClose,
  267. procCreat,
  268. procDup,
  269. procDup2,
  270. procExit,
  271. procFchdir,
  272. procFchmod,
  273. procFchmodat,
  274. procFchown,
  275. procFchownat,
  276. procFdatasync,
  277. procFpathconf,
  278. procFstat,
  279. procGetdents,
  280. procGetgid,
  281. procGetpid,
  282. procGetpgid,
  283. procGetpgrp,
  284. procGeteuid,
  285. procGetegid,
  286. procGetppid,
  287. procGetpriority,
  288. procGetrlimit,
  289. procGetrusage,
  290. procGettimeofday,
  291. procGetuid,
  292. procKill,
  293. procLchown,
  294. procLink,
  295. proclisten,
  296. procLstat,
  297. procMadvise,
  298. procMkdir,
  299. procMkdirat,
  300. procMkfifo,
  301. procMkfifoat,
  302. procMknod,
  303. procMknodat,
  304. procMlock,
  305. procMlockall,
  306. procMprotect,
  307. procMunlock,
  308. procMunlockall,
  309. procNanosleep,
  310. procOpen,
  311. procOpenat,
  312. procPathconf,
  313. procPause,
  314. procPread,
  315. procPwrite,
  316. procread,
  317. procReadlink,
  318. procRename,
  319. procRenameat,
  320. procRmdir,
  321. proclseek,
  322. procSetegid,
  323. procSeteuid,
  324. procSetgid,
  325. procSethostname,
  326. procSetpgid,
  327. procSetpriority,
  328. procSetregid,
  329. procSetreuid,
  330. procSetrlimit,
  331. procSetsid,
  332. procSetuid,
  333. procshutdown,
  334. procStat,
  335. procSymlink,
  336. procSync,
  337. procTimes,
  338. procTruncate,
  339. procFsync,
  340. procFtruncate,
  341. procUmask,
  342. procUname,
  343. procumount,
  344. procUnlink,
  345. procUnlinkat,
  346. procUstat,
  347. procUtime,
  348. procbind,
  349. procconnect,
  350. procmmap,
  351. procmunmap,
  352. procsendto,
  353. procsocket,
  354. procsocketpair,
  355. procwrite,
  356. procgetsockopt,
  357. procgetpeername,
  358. procsetsockopt,
  359. procrecvfrom,
  360. procsysconf syscallFunc
  361. )
  362. func pipe(p *[2]_C_int) (n int, err error) {
  363. r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe)), 1, uintptr(unsafe.Pointer(p)), 0, 0, 0, 0, 0)
  364. n = int(r0)
  365. if e1 != 0 {
  366. err = e1
  367. }
  368. return
  369. }
  370. func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
  371. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
  372. if e1 != 0 {
  373. err = e1
  374. }
  375. return
  376. }
  377. func Getcwd(buf []byte) (n int, err error) {
  378. var _p0 *byte
  379. if len(buf) > 0 {
  380. _p0 = &buf[0]
  381. }
  382. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetcwd)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0)
  383. n = int(r0)
  384. if e1 != 0 {
  385. err = e1
  386. }
  387. return
  388. }
  389. func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
  390. r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
  391. n = int(r0)
  392. if e1 != 0 {
  393. err = e1
  394. }
  395. return
  396. }
  397. func setgroups(ngid int, gid *_Gid_t) (err error) {
  398. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0)
  399. if e1 != 0 {
  400. err = e1
  401. }
  402. return
  403. }
  404. func wait4(pid int32, statusp *_C_int, options int, rusage *Rusage) (wpid int32, err error) {
  405. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwait4)), 4, uintptr(pid), uintptr(unsafe.Pointer(statusp)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
  406. wpid = int32(r0)
  407. if e1 != 0 {
  408. err = e1
  409. }
  410. return
  411. }
  412. func gethostname(buf []byte) (n int, err error) {
  413. var _p0 *byte
  414. if len(buf) > 0 {
  415. _p0 = &buf[0]
  416. }
  417. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0, 0, 0, 0)
  418. n = int(r0)
  419. if e1 != 0 {
  420. err = e1
  421. }
  422. return
  423. }
  424. func utimes(path string, times *[2]Timeval) (err error) {
  425. var _p0 *byte
  426. _p0, err = BytePtrFromString(path)
  427. if err != nil {
  428. return
  429. }
  430. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0)
  431. if e1 != 0 {
  432. err = e1
  433. }
  434. return
  435. }
  436. func utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) {
  437. var _p0 *byte
  438. _p0, err = BytePtrFromString(path)
  439. if err != nil {
  440. return
  441. }
  442. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimensat)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)
  443. if e1 != 0 {
  444. err = e1
  445. }
  446. return
  447. }
  448. func fcntl(fd int, cmd int, arg int) (val int, err error) {
  449. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)
  450. val = int(r0)
  451. if e1 != 0 {
  452. err = e1
  453. }
  454. return
  455. }
  456. func futimesat(fildes int, path *byte, times *[2]Timeval) (err error) {
  457. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfutimesat)), 3, uintptr(fildes), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)), 0, 0, 0)
  458. if e1 != 0 {
  459. err = e1
  460. }
  461. return
  462. }
  463. func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
  464. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procaccept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
  465. fd = int(r0)
  466. if e1 != 0 {
  467. err = e1
  468. }
  469. return
  470. }
  471. func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
  472. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procrecvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
  473. n = int(r0)
  474. if e1 != 0 {
  475. err = e1
  476. }
  477. return
  478. }
  479. func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
  480. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0)
  481. n = int(r0)
  482. if e1 != 0 {
  483. err = e1
  484. }
  485. return
  486. }
  487. func acct(path *byte) (err error) {
  488. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procacct)), 1, uintptr(unsafe.Pointer(path)), 0, 0, 0, 0, 0)
  489. if e1 != 0 {
  490. err = e1
  491. }
  492. return
  493. }
  494. func ioctl(fd int, req int, arg uintptr) (err error) {
  495. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0)
  496. if e1 != 0 {
  497. err = e1
  498. }
  499. return
  500. }
  501. func Access(path string, mode uint32) (err error) {
  502. var _p0 *byte
  503. _p0, err = BytePtrFromString(path)
  504. if err != nil {
  505. return
  506. }
  507. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAccess)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
  508. if e1 != 0 {
  509. err = e1
  510. }
  511. return
  512. }
  513. func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
  514. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAdjtime)), 2, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0, 0, 0, 0)
  515. if e1 != 0 {
  516. err = e1
  517. }
  518. return
  519. }
  520. func Chdir(path string) (err error) {
  521. var _p0 *byte
  522. _p0, err = BytePtrFromString(path)
  523. if err != nil {
  524. return
  525. }
  526. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
  527. if e1 != 0 {
  528. err = e1
  529. }
  530. return
  531. }
  532. func Chmod(path string, mode uint32) (err error) {
  533. var _p0 *byte
  534. _p0, err = BytePtrFromString(path)
  535. if err != nil {
  536. return
  537. }
  538. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
  539. if e1 != 0 {
  540. err = e1
  541. }
  542. return
  543. }
  544. func Chown(path string, uid int, gid int) (err error) {
  545. var _p0 *byte
  546. _p0, err = BytePtrFromString(path)
  547. if err != nil {
  548. return
  549. }
  550. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
  551. if e1 != 0 {
  552. err = e1
  553. }
  554. return
  555. }
  556. func Chroot(path string) (err error) {
  557. var _p0 *byte
  558. _p0, err = BytePtrFromString(path)
  559. if err != nil {
  560. return
  561. }
  562. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
  563. if e1 != 0 {
  564. err = e1
  565. }
  566. return
  567. }
  568. func Close(fd int) (err error) {
  569. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClose)), 1, uintptr(fd), 0, 0, 0, 0, 0)
  570. if e1 != 0 {
  571. err = e1
  572. }
  573. return
  574. }
  575. func Creat(path string, mode uint32) (fd int, err error) {
  576. var _p0 *byte
  577. _p0, err = BytePtrFromString(path)
  578. if err != nil {
  579. return
  580. }
  581. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procCreat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
  582. fd = int(r0)
  583. if e1 != 0 {
  584. err = e1
  585. }
  586. return
  587. }
  588. func Dup(fd int) (nfd int, err error) {
  589. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup)), 1, uintptr(fd), 0, 0, 0, 0, 0)
  590. nfd = int(r0)
  591. if e1 != 0 {
  592. err = e1
  593. }
  594. return
  595. }
  596. func Dup2(oldfd int, newfd int) (err error) {
  597. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup2)), 2, uintptr(oldfd), uintptr(newfd), 0, 0, 0, 0)
  598. if e1 != 0 {
  599. err = e1
  600. }
  601. return
  602. }
  603. func Exit(code int) {
  604. sysvicall6(uintptr(unsafe.Pointer(&procExit)), 1, uintptr(code), 0, 0, 0, 0, 0)
  605. return
  606. }
  607. func Fchdir(fd int) (err error) {
  608. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0)
  609. if e1 != 0 {
  610. err = e1
  611. }
  612. return
  613. }
  614. func Fchmod(fd int, mode uint32) (err error) {
  615. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0)
  616. if e1 != 0 {
  617. err = e1
  618. }
  619. return
  620. }
  621. func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
  622. var _p0 *byte
  623. _p0, err = BytePtrFromString(path)
  624. if err != nil {
  625. return
  626. }
  627. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
  628. if e1 != 0 {
  629. err = e1
  630. }
  631. return
  632. }
  633. func Fchown(fd int, uid int, gid int) (err error) {
  634. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0)
  635. if e1 != 0 {
  636. err = e1
  637. }
  638. return
  639. }
  640. func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
  641. var _p0 *byte
  642. _p0, err = BytePtrFromString(path)
  643. if err != nil {
  644. return
  645. }
  646. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchownat)), 5, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
  647. if e1 != 0 {
  648. err = e1
  649. }
  650. return
  651. }
  652. func Fdatasync(fd int) (err error) {
  653. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFdatasync)), 1, uintptr(fd), 0, 0, 0, 0, 0)
  654. if e1 != 0 {
  655. err = e1
  656. }
  657. return
  658. }
  659. func Fpathconf(fd int, name int) (val int, err error) {
  660. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0)
  661. val = int(r0)
  662. if e1 != 0 {
  663. err = e1
  664. }
  665. return
  666. }
  667. func Fstat(fd int, stat *Stat_t) (err error) {
  668. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
  669. if e1 != 0 {
  670. err = e1
  671. }
  672. return
  673. }
  674. func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) {
  675. var _p0 *byte
  676. if len(buf) > 0 {
  677. _p0 = &buf[0]
  678. }
  679. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetdents)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
  680. n = int(r0)
  681. if e1 != 0 {
  682. err = e1
  683. }
  684. return
  685. }
  686. func Getgid() (gid int) {
  687. r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetgid)), 0, 0, 0, 0, 0, 0, 0)
  688. gid = int(r0)
  689. return
  690. }
  691. func Getpid() (pid int) {
  692. r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpid)), 0, 0, 0, 0, 0, 0, 0)
  693. pid = int(r0)
  694. return
  695. }
  696. func Getpgid(pid int) (pgid int, err error) {
  697. r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0)
  698. pgid = int(r0)
  699. if e1 != 0 {
  700. err = e1
  701. }
  702. return
  703. }
  704. func Getpgrp() (pgid int, err error) {
  705. r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgrp)), 0, 0, 0, 0, 0, 0, 0)
  706. pgid = int(r0)
  707. if e1 != 0 {
  708. err = e1
  709. }
  710. return
  711. }
  712. func Geteuid() (euid int) {
  713. r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGeteuid)), 0, 0, 0, 0, 0, 0, 0)
  714. euid = int(r0)
  715. return
  716. }
  717. func Getegid() (egid int) {
  718. r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetegid)), 0, 0, 0, 0, 0, 0, 0)
  719. egid = int(r0)
  720. return
  721. }
  722. func Getppid() (ppid int) {
  723. r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetppid)), 0, 0, 0, 0, 0, 0, 0)
  724. ppid = int(r0)
  725. return
  726. }
  727. func Getpriority(which int, who int) (n int, err error) {
  728. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0)
  729. n = int(r0)
  730. if e1 != 0 {
  731. err = e1
  732. }
  733. return
  734. }
  735. func Getrlimit(which int, lim *Rlimit) (err error) {
  736. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
  737. if e1 != 0 {
  738. err = e1
  739. }
  740. return
  741. }
  742. func Getrusage(who int, rusage *Rusage) (err error) {
  743. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0)
  744. if e1 != 0 {
  745. err = e1
  746. }
  747. return
  748. }
  749. func Gettimeofday(tv *Timeval) (err error) {
  750. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0)
  751. if e1 != 0 {
  752. err = e1
  753. }
  754. return
  755. }
  756. func Getuid() (uid int) {
  757. r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetuid)), 0, 0, 0, 0, 0, 0, 0)
  758. uid = int(r0)
  759. return
  760. }
  761. func Kill(pid int, signum syscall.Signal) (err error) {
  762. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procKill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0)
  763. if e1 != 0 {
  764. err = e1
  765. }
  766. return
  767. }
  768. func Lchown(path string, uid int, gid int) (err error) {
  769. var _p0 *byte
  770. _p0, err = BytePtrFromString(path)
  771. if err != nil {
  772. return
  773. }
  774. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0)
  775. if e1 != 0 {
  776. err = e1
  777. }
  778. return
  779. }
  780. func Link(path string, link string) (err error) {
  781. var _p0 *byte
  782. _p0, err = BytePtrFromString(path)
  783. if err != nil {
  784. return
  785. }
  786. var _p1 *byte
  787. _p1, err = BytePtrFromString(link)
  788. if err != nil {
  789. return
  790. }
  791. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
  792. if e1 != 0 {
  793. err = e1
  794. }
  795. return
  796. }
  797. func Listen(s int, backlog int) (err error) {
  798. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0)
  799. if e1 != 0 {
  800. err = e1
  801. }
  802. return
  803. }
  804. func Lstat(path string, stat *Stat_t) (err error) {
  805. var _p0 *byte
  806. _p0, err = BytePtrFromString(path)
  807. if err != nil {
  808. return
  809. }
  810. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
  811. if e1 != 0 {
  812. err = e1
  813. }
  814. return
  815. }
  816. func Madvise(b []byte, advice int) (err error) {
  817. var _p0 *byte
  818. if len(b) > 0 {
  819. _p0 = &b[0]
  820. }
  821. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMadvise)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(advice), 0, 0, 0)
  822. if e1 != 0 {
  823. err = e1
  824. }
  825. return
  826. }
  827. func Mkdir(path string, mode uint32) (err error) {
  828. var _p0 *byte
  829. _p0, err = BytePtrFromString(path)
  830. if err != nil {
  831. return
  832. }
  833. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
  834. if e1 != 0 {
  835. err = e1
  836. }
  837. return
  838. }
  839. func Mkdirat(dirfd int, path string, mode uint32) (err error) {
  840. var _p0 *byte
  841. _p0, err = BytePtrFromString(path)
  842. if err != nil {
  843. return
  844. }
  845. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdirat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)
  846. if e1 != 0 {
  847. err = e1
  848. }
  849. return
  850. }
  851. func Mkfifo(path string, mode uint32) (err error) {
  852. var _p0 *byte
  853. _p0, err = BytePtrFromString(path)
  854. if err != nil {
  855. return
  856. }
  857. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifo)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0)
  858. if e1 != 0 {
  859. err = e1
  860. }
  861. return
  862. }
  863. func Mkfifoat(dirfd int, path string, mode uint32) (err error) {
  864. var _p0 *byte
  865. _p0, err = BytePtrFromString(path)
  866. if err != nil {
  867. return
  868. }
  869. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifoat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0)
  870. if e1 != 0 {
  871. err = e1
  872. }
  873. return
  874. }
  875. func Mknod(path string, mode uint32, dev int) (err error) {
  876. var _p0 *byte
  877. _p0, err = BytePtrFromString(path)
  878. if err != nil {
  879. return
  880. }
  881. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknod)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0, 0)
  882. if e1 != 0 {
  883. err = e1
  884. }
  885. return
  886. }
  887. func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
  888. var _p0 *byte
  889. _p0, err = BytePtrFromString(path)
  890. if err != nil {
  891. return
  892. }
  893. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
  894. if e1 != 0 {
  895. err = e1
  896. }
  897. return
  898. }
  899. func Mlock(b []byte) (err error) {
  900. var _p0 *byte
  901. if len(b) > 0 {
  902. _p0 = &b[0]
  903. }
  904. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)
  905. if e1 != 0 {
  906. err = e1
  907. }
  908. return
  909. }
  910. func Mlockall(flags int) (err error) {
  911. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlockall)), 1, uintptr(flags), 0, 0, 0, 0, 0)
  912. if e1 != 0 {
  913. err = e1
  914. }
  915. return
  916. }
  917. func Mprotect(b []byte, prot int) (err error) {
  918. var _p0 *byte
  919. if len(b) > 0 {
  920. _p0 = &b[0]
  921. }
  922. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMprotect)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(prot), 0, 0, 0)
  923. if e1 != 0 {
  924. err = e1
  925. }
  926. return
  927. }
  928. func Munlock(b []byte) (err error) {
  929. var _p0 *byte
  930. if len(b) > 0 {
  931. _p0 = &b[0]
  932. }
  933. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlock)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), 0, 0, 0, 0)
  934. if e1 != 0 {
  935. err = e1
  936. }
  937. return
  938. }
  939. func Munlockall() (err error) {
  940. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlockall)), 0, 0, 0, 0, 0, 0, 0)
  941. if e1 != 0 {
  942. err = e1
  943. }
  944. return
  945. }
  946. func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
  947. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procNanosleep)), 2, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0, 0, 0, 0)
  948. if e1 != 0 {
  949. err = e1
  950. }
  951. return
  952. }
  953. func Open(path string, mode int, perm uint32) (fd int, err error) {
  954. var _p0 *byte
  955. _p0, err = BytePtrFromString(path)
  956. if err != nil {
  957. return
  958. }
  959. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpen)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0)
  960. fd = int(r0)
  961. if e1 != 0 {
  962. err = e1
  963. }
  964. return
  965. }
  966. func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
  967. var _p0 *byte
  968. _p0, err = BytePtrFromString(path)
  969. if err != nil {
  970. return
  971. }
  972. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpenat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)
  973. fd = int(r0)
  974. if e1 != 0 {
  975. err = e1
  976. }
  977. return
  978. }
  979. func Pathconf(path string, name int) (val int, err error) {
  980. var _p0 *byte
  981. _p0, err = BytePtrFromString(path)
  982. if err != nil {
  983. return
  984. }
  985. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPathconf)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0, 0, 0, 0)
  986. val = int(r0)
  987. if e1 != 0 {
  988. err = e1
  989. }
  990. return
  991. }
  992. func Pause() (err error) {
  993. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPause)), 0, 0, 0, 0, 0, 0, 0)
  994. if e1 != 0 {
  995. err = e1
  996. }
  997. return
  998. }
  999. func Pread(fd int, p []byte, offset int64) (n int, err error) {
  1000. var _p0 *byte
  1001. if len(p) > 0 {
  1002. _p0 = &p[0]
  1003. }
  1004. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
  1005. n = int(r0)
  1006. if e1 != 0 {
  1007. err = e1
  1008. }
  1009. return
  1010. }
  1011. func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
  1012. var _p0 *byte
  1013. if len(p) > 0 {
  1014. _p0 = &p[0]
  1015. }
  1016. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0)
  1017. n = int(r0)
  1018. if e1 != 0 {
  1019. err = e1
  1020. }
  1021. return
  1022. }
  1023. func read(fd int, p []byte) (n int, err error) {
  1024. var _p0 *byte
  1025. if len(p) > 0 {
  1026. _p0 = &p[0]
  1027. }
  1028. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procread)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
  1029. n = int(r0)
  1030. if e1 != 0 {
  1031. err = e1
  1032. }
  1033. return
  1034. }
  1035. func Readlink(path string, buf []byte) (n int, err error) {
  1036. var _p0 *byte
  1037. _p0, err = BytePtrFromString(path)
  1038. if err != nil {
  1039. return
  1040. }
  1041. var _p1 *byte
  1042. if len(buf) > 0 {
  1043. _p1 = &buf[0]
  1044. }
  1045. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procReadlink)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), 0, 0, 0)
  1046. n = int(r0)
  1047. if e1 != 0 {
  1048. err = e1
  1049. }
  1050. return
  1051. }
  1052. func Rename(from string, to string) (err error) {
  1053. var _p0 *byte
  1054. _p0, err = BytePtrFromString(from)
  1055. if err != nil {
  1056. return
  1057. }
  1058. var _p1 *byte
  1059. _p1, err = BytePtrFromString(to)
  1060. if err != nil {
  1061. return
  1062. }
  1063. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
  1064. if e1 != 0 {
  1065. err = e1
  1066. }
  1067. return
  1068. }
  1069. func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
  1070. var _p0 *byte
  1071. _p0, err = BytePtrFromString(oldpath)
  1072. if err != nil {
  1073. return
  1074. }
  1075. var _p1 *byte
  1076. _p1, err = BytePtrFromString(newpath)
  1077. if err != nil {
  1078. return
  1079. }
  1080. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRenameat)), 4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)
  1081. if e1 != 0 {
  1082. err = e1
  1083. }
  1084. return
  1085. }
  1086. func Rmdir(path string) (err error) {
  1087. var _p0 *byte
  1088. _p0, err = BytePtrFromString(path)
  1089. if err != nil {
  1090. return
  1091. }
  1092. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
  1093. if e1 != 0 {
  1094. err = e1
  1095. }
  1096. return
  1097. }
  1098. func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
  1099. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0)
  1100. newoffset = int64(r0)
  1101. if e1 != 0 {
  1102. err = e1
  1103. }
  1104. return
  1105. }
  1106. func Setegid(egid int) (err error) {
  1107. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetegid)), 1, uintptr(egid), 0, 0, 0, 0, 0)
  1108. if e1 != 0 {
  1109. err = e1
  1110. }
  1111. return
  1112. }
  1113. func Seteuid(euid int) (err error) {
  1114. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSeteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0)
  1115. if e1 != 0 {
  1116. err = e1
  1117. }
  1118. return
  1119. }
  1120. func Setgid(gid int) (err error) {
  1121. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetgid)), 1, uintptr(gid), 0, 0, 0, 0, 0)
  1122. if e1 != 0 {
  1123. err = e1
  1124. }
  1125. return
  1126. }
  1127. func Sethostname(p []byte) (err error) {
  1128. var _p0 *byte
  1129. if len(p) > 0 {
  1130. _p0 = &p[0]
  1131. }
  1132. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSethostname)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0, 0)
  1133. if e1 != 0 {
  1134. err = e1
  1135. }
  1136. return
  1137. }
  1138. func Setpgid(pid int, pgid int) (err error) {
  1139. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0)
  1140. if e1 != 0 {
  1141. err = e1
  1142. }
  1143. return
  1144. }
  1145. func Setpriority(which int, who int, prio int) (err error) {
  1146. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSetpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0)
  1147. if e1 != 0 {
  1148. err = e1
  1149. }
  1150. return
  1151. }
  1152. func Setregid(rgid int, egid int) (err error) {
  1153. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0)
  1154. if e1 != 0 {
  1155. err = e1
  1156. }
  1157. return
  1158. }
  1159. func Setreuid(ruid int, euid int) (err error) {
  1160. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0)
  1161. if e1 != 0 {
  1162. err = e1
  1163. }
  1164. return
  1165. }
  1166. func Setrlimit(which int, lim *Rlimit) (err error) {
  1167. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
  1168. if e1 != 0 {
  1169. err = e1
  1170. }
  1171. return
  1172. }
  1173. func Setsid() (pid int, err error) {
  1174. r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetsid)), 0, 0, 0, 0, 0, 0, 0)
  1175. pid = int(r0)
  1176. if e1 != 0 {
  1177. err = e1
  1178. }
  1179. return
  1180. }
  1181. func Setuid(uid int) (err error) {
  1182. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetuid)), 1, uintptr(uid), 0, 0, 0, 0, 0)
  1183. if e1 != 0 {
  1184. err = e1
  1185. }
  1186. return
  1187. }
  1188. func Shutdown(s int, how int) (err error) {
  1189. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procshutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0)
  1190. if e1 != 0 {
  1191. err = e1
  1192. }
  1193. return
  1194. }
  1195. func Stat(path string, stat *Stat_t) (err error) {
  1196. var _p0 *byte
  1197. _p0, err = BytePtrFromString(path)
  1198. if err != nil {
  1199. return
  1200. }
  1201. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0)
  1202. if e1 != 0 {
  1203. err = e1
  1204. }
  1205. return
  1206. }
  1207. func Symlink(path string, link string) (err error) {
  1208. var _p0 *byte
  1209. _p0, err = BytePtrFromString(path)
  1210. if err != nil {
  1211. return
  1212. }
  1213. var _p1 *byte
  1214. _p1, err = BytePtrFromString(link)
  1215. if err != nil {
  1216. return
  1217. }
  1218. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSymlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0)
  1219. if e1 != 0 {
  1220. err = e1
  1221. }
  1222. return
  1223. }
  1224. func Sync() (err error) {
  1225. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSync)), 0, 0, 0, 0, 0, 0, 0)
  1226. if e1 != 0 {
  1227. err = e1
  1228. }
  1229. return
  1230. }
  1231. func Times(tms *Tms) (ticks uintptr, err error) {
  1232. r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procTimes)), 1, uintptr(unsafe.Pointer(tms)), 0, 0, 0, 0, 0)
  1233. ticks = uintptr(r0)
  1234. if e1 != 0 {
  1235. err = e1
  1236. }
  1237. return
  1238. }
  1239. func Truncate(path string, length int64) (err error) {
  1240. var _p0 *byte
  1241. _p0, err = BytePtrFromString(path)
  1242. if err != nil {
  1243. return
  1244. }
  1245. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procTruncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0)
  1246. if e1 != 0 {
  1247. err = e1
  1248. }
  1249. return
  1250. }
  1251. func Fsync(fd int) (err error) {
  1252. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFsync)), 1, uintptr(fd), 0, 0, 0, 0, 0)
  1253. if e1 != 0 {
  1254. err = e1
  1255. }
  1256. return
  1257. }
  1258. func Ftruncate(fd int, length int64) (err error) {
  1259. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFtruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0)
  1260. if e1 != 0 {
  1261. err = e1
  1262. }
  1263. return
  1264. }
  1265. func Umask(mask int) (oldmask int) {
  1266. r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procUmask)), 1, uintptr(mask), 0, 0, 0, 0, 0)
  1267. oldmask = int(r0)
  1268. return
  1269. }
  1270. func Uname(buf *Utsname) (err error) {
  1271. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procUname)), 1, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0)
  1272. if e1 != 0 {
  1273. err = e1
  1274. }
  1275. return
  1276. }
  1277. func Unmount(target string, flags int) (err error) {
  1278. var _p0 *byte
  1279. _p0, err = BytePtrFromString(target)
  1280. if err != nil {
  1281. return
  1282. }
  1283. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procumount)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0, 0)
  1284. if e1 != 0 {
  1285. err = e1
  1286. }
  1287. return
  1288. }
  1289. func Unlink(path string) (err error) {
  1290. var _p0 *byte
  1291. _p0, err = BytePtrFromString(path)
  1292. if err != nil {
  1293. return
  1294. }
  1295. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0)
  1296. if e1 != 0 {
  1297. err = e1
  1298. }
  1299. return
  1300. }
  1301. func Unlinkat(dirfd int, path string, flags int) (err error) {
  1302. var _p0 *byte
  1303. _p0, err = BytePtrFromString(path)
  1304. if err != nil {
  1305. return
  1306. }
  1307. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlinkat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0)
  1308. if e1 != 0 {
  1309. err = e1
  1310. }
  1311. return
  1312. }
  1313. func Ustat(dev int, ubuf *Ustat_t) (err error) {
  1314. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUstat)), 2, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0, 0, 0, 0)
  1315. if e1 != 0 {
  1316. err = e1
  1317. }
  1318. return
  1319. }
  1320. func Utime(path string, buf *Utimbuf) (err error) {
  1321. var _p0 *byte
  1322. _p0, err = BytePtrFromString(path)
  1323. if err != nil {
  1324. return
  1325. }
  1326. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUtime)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0)
  1327. if e1 != 0 {
  1328. err = e1
  1329. }
  1330. return
  1331. }
  1332. func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
  1333. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procbind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
  1334. if e1 != 0 {
  1335. err = e1
  1336. }
  1337. return
  1338. }
  1339. func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
  1340. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procconnect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0)
  1341. if e1 != 0 {
  1342. err = e1
  1343. }
  1344. return
  1345. }
  1346. func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
  1347. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
  1348. ret = uintptr(r0)
  1349. if e1 != 0 {
  1350. err = e1
  1351. }
  1352. return
  1353. }
  1354. func munmap(addr uintptr, length uintptr) (err error) {
  1355. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmunmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0)
  1356. if e1 != 0 {
  1357. err = e1
  1358. }
  1359. return
  1360. }
  1361. func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
  1362. var _p0 *byte
  1363. if len(buf) > 0 {
  1364. _p0 = &buf[0]
  1365. }
  1366. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendto)), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
  1367. if e1 != 0 {
  1368. err = e1
  1369. }
  1370. return
  1371. }
  1372. func socket(domain int, typ int, proto int) (fd int, err error) {
  1373. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsocket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0)
  1374. fd = int(r0)
  1375. if e1 != 0 {
  1376. err = e1
  1377. }
  1378. return
  1379. }
  1380. func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
  1381. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsocketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
  1382. if e1 != 0 {
  1383. err = e1
  1384. }
  1385. return
  1386. }
  1387. func write(fd int, p []byte) (n int, err error) {
  1388. var _p0 *byte
  1389. if len(p) > 0 {
  1390. _p0 = &p[0]
  1391. }
  1392. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwrite)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0, 0, 0)
  1393. n = int(r0)
  1394. if e1 != 0 {
  1395. err = e1
  1396. }
  1397. return
  1398. }
  1399. func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
  1400. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
  1401. if e1 != 0 {
  1402. err = e1
  1403. }
  1404. return
  1405. }
  1406. func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
  1407. _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
  1408. if e1 != 0 {
  1409. err = e1
  1410. }
  1411. return
  1412. }
  1413. func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
  1414. _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
  1415. if e1 != 0 {
  1416. err = e1
  1417. }
  1418. return
  1419. }
  1420. func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
  1421. var _p0 *byte
  1422. if len(p) > 0 {
  1423. _p0 = &p[0]
  1424. }
  1425. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procrecvfrom)), 6, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
  1426. n = int(r0)
  1427. if e1 != 0 {
  1428. err = e1
  1429. }
  1430. return
  1431. }
  1432. func sysconf(name int) (n int64, err error) {
  1433. r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsysconf)), 1, uintptr(name), 0, 0, 0, 0, 0)
  1434. n = int64(r0)
  1435. if e1 != 0 {
  1436. err = e1
  1437. }
  1438. return
  1439. }