vendor
github.com
Microsoft
ProtonMail
go-crypto
openpgp
packet
aead_config.go aead_crypter.go aead_encrypted.go compressed.go config.go config_v5.go encrypted_key.go literal.go marker.go notation.go ocfb.go one_pass_signature.go opaque.go packet.go packet_sequence.go packet_unsupported.go padding.go private_key.go private_key_test_data.go public_key.go public_key_test_data.go reader.go recipient.go signature.go symmetric_key_encrypted.go symmetrically_encrypted.go symmetrically_encrypted_aead.go symmetrically_encrypted_mdc.go userattribute.go userid.goalecthomas
chroma
v2
lexers
embedded
abap.xml abnf.xml actionscript.xml actionscript_3.xml ada.xml agda.xml al.xml alloy.xml ampl.xml angular2.xml antlr.xml apacheconf.xml apl.xml applescript.xml arangodb_aql.xml arduino.xml armasm.xml atl.xml autohotkey.xml autoit.xml awk.xml ballerina.xml bash.xml bash_session.xml batchfile.xml beef.xml bibtex.xml bicep.xml blitzbasic.xml bnf.xml bqn.xml brainfuck.xml c#.xml c++.xml c.xml c3.xml cap_n_proto.xml cassandra_cql.xml ceylon.xml cfengine3.xml cfstatement.xml chaiscript.xml chapel.xml cheetah.xml clojure.xml cmake.xml cobol.xml coffeescript.xml common_lisp.xml coq.xml core.xml crystal.xml css.xml csv.xml cue.xml cython.xml d.xml dart.xml dax.xml desktop_entry.xml devicetree.xml diff.xml django_jinja.xml dns.xml docker.xml dtd.xml dylan.xml ebnf.xml elixir.xml elm.xml emacslisp.xml erb.xml erlang.xml factor.xml fennel.xml fish.xml forth.xml fortran.xml fortranfixed.xml fsharp.xml gas.xml gdscript.xml gdscript3.xml gettext.xml gherkin.xml gleam.xml glsl.xml gnuplot.xml go_template.xml graphql.xml groff.xml groovy.xml handlebars.xml hare.xml haskell.xml hcl.xml hexdump.xml hlb.xml hlsl.xml holyc.xml html.xml hy.xml idris.xml igor.xml ini.xml io.xml iscdhcpd.xml j.xml janet.xml java.xml javascript.xml json.xml jsonata.xml jsonnet.xml julia.xml jungle.xml kakoune.xml kdl.xml kotlin.xml lateralus.xml lean.xml lighttpd_configuration_file.xml llvm.xml lox.xml lua.xml luau.xml makefile.xml mako.xml mason.xml materialize_sql_dialect.xml mathematica.xml matlab.xml mcfunction.xml meson.xml metal.xml microcad.xml minizinc.xml mlir.xml modelica.xml modula-2.xml mojo.xml monkeyc.xml moonbit.xml moonscript.xml morrowindscript.xml myghty.xml mysql.xml nasm.xml natural.xml ndisasm.xml newspeak.xml nginx_configuration_file.xml nim.xml nix.xml nsis.xml nu.xml objective-c.xml objectpascal.xml ocaml.xml octave.xml odin.xml onesenterprise.xml openedge_abl.xml openscad.xml org_mode.xml pacmanconf.xml perl.xml php.xml pig.xml pkgconfig.xml pl_pgsql.xml plaintext.xml plutus_core.xml pony.xml postgresql_sql_dialect.xml postscript.xml povray.xml powerquery.xml powershell.xml prolog.xml promela.xml promql.xml properties.xml protocol_buffer.xml prql.xml psl.xml puppet.xml python.xml python_2.xml qbasic.xml qml.xml r.xml racket.xml ragel.xml react.xml reasonml.xml reg.xml rego.xml rexx.xml rgbasm.xml ring.xml rpgle.xml rpm_spec.xml ruby.xml rust.xml sas.xml sass.xml scala.xml scdoc.xml scheme.xml scilab.xml scss.xml sed.xml sieve.xml smali.xml smalltalk.xml smarty.xml snbt.xml snobol.xml solidity.xml sourcepawn.xml spade.xml sparql.xml sql.xml squidconf.xml standard_ml.xml stas.xml stylus.xml swift.xml systemd.xml systemverilog.xml tablegen.xml tal.xml tasm.xml tcl.xml tcsh.xml termcap.xml terminfo.xml terraform.xml tex.xml thrift.xml toml.xml tradingview.xml transact-sql.xml turing.xml turtle.xml twig.xml txtpb.xml typescript.xml typoscript.xml typoscriptcssdata.xml typoscripthtmldata.xml typst.xml ucode.xml v.xml v_shell.xml vala.xml vb_net.xml verilog.xml vhdl.xml vhs.xml viml.xml vue.xml wat.xml wdte.xml webgpu_shading_language.xml webvtt.xml whiley.xml xml.xml xorg.xml yaml.xml yang.xml z80_assembly.xml zed.xml zig.xmlstyles
abap.xml algol.xml algol_nu.xml api.go arduino.xml ashen.xml aura-theme-dark-soft.xml aura-theme-dark.xml autumn.xml average.xml base16-snazzy.xml borland.xml bw.xml catppuccin-frappe.xml catppuccin-latte.xml catppuccin-macchiato.xml catppuccin-mocha.xml colorful.xml compat.go darcula.xml doom-one.xml doom-one2.xml dracula.xml emacs.xml evergarden.xml friendly.xml fruity.xml github-dark.xml github.xml gruvbox-light.xml gruvbox.xml hr_high_contrast.xml hrdark.xml igor.xml kanagawa-dragon.xml kanagawa-lotus.xml kanagawa-wave.xml lovelace.xml manni.xml modus-operandi.xml modus-vivendi.xml monokai.xml monokailight.xml murphy.xml native.xml nord.xml nordic.xml onedark.xml onesenterprise.xml paraiso-dark.xml paraiso-light.xml pastie.xml perldoc.xml pygments.xml rainbow_dash.xml rose-pine-dawn.xml rose-pine-moon.xml rose-pine.xml rpgle.xml rrt.xml solarized-dark.xml solarized-dark256.xml solarized-light.xml swapoff.xml tango.xml tokyonight-day.xml tokyonight-moon.xml tokyonight-night.xml tokyonight-storm.xml trac.xml vim.xml vs.xml vulcan.xml witchhazel.xml xcode-dark.xml xcode.xmlcloudflare
go-enry
go-enry
v2
data
alias.go colors.go commit.go content.go doc.go documentation.go extension.go filename.go frequencies.go generated.go groups.go heuristics.go id.go interpreter.go languageInfo.go mimeType.go test.go type.go vendor.gogo-git
go-git
v5
plumbing
format
object
blob.go change.go change_adaptor.go commit.go commit_scanner.go commit_walker.go commit_walker_bfs.go commit_walker_bfs_filtered.go commit_walker_ctime.go commit_walker_limit.go commit_walker_path.go difftree.go file.go merge_base.go object.go patch.go rename.go signature.go tag.go tag_scanner.go tree.go treenoder.goprotocol
storage
filesystem
dotgit
dotgit.go dotgit_rewrite_packed_refs.go dotgit_setref.go reader.go repository_filesystem.go writers.go writers_unix.go writers_windows.goklauspost
cpuid
v2
.gitignore .goreleaser.yml CONTRIBUTING.txt LICENSE README.md cpuid.go cpuid_386.s cpuid_amd64.s cpuid_arm64.s detect_arm64.go detect_ref.go detect_x86.go featureid_string.go os_darwin_arm64.go os_linux_arm64.go os_other_arm64.go os_safe_linux_arm64.go os_unsafe_linux_arm64.go test-architectures.shyuin
goldmark
extension
cjk.go definition_list.go footnote.go gfm.go linkify.go package.go strikethrough.go table.go tasklist.go typographer.goparser
attribute.go atx_heading.go auto_link.go blockquote.go code_block.go code_span.go delimiter.go emphasis.go fcode_block.go html_block.go link.go link_ref.go list.go list_item.go paragraph.go parser.go raw_html.go setext_headings.go thematic_break.goutil
html5entities.gen.go html5entities.go unicode_case_folding.gen.go unicode_case_folding.go util.go util_cjk.go util_safe.go util_unsafe_go120.go util_unsafe_go121.gogolang.org
x
crypto
blake2b
blake2b.go blake2bAVX2_amd64.go blake2bAVX2_amd64.s blake2b_amd64.s blake2b_generic.go blake2b_ref.go blake2x.go go125.go register.gochacha20
chacha_arm64.go chacha_arm64.s chacha_generic.go chacha_noasm.go chacha_ppc64x.go chacha_ppc64x.s chacha_s390x.go chacha_s390x.s xor.gossh
buffer.go certs.go channel.go cipher.go client.go client_auth.go common.go connection.go doc.go handshake.go kex.go keys.go mac.go messages.go mlkem.go mux.go server.go session.go ssh_gss.go streamlocal.go tcpip.go transport.gosys
cpu
asm_aix_ppc64.s asm_darwin_arm64_gc.s asm_darwin_x86_gc.s byteorder.go cpu.go cpu_aix.go cpu_arm.go cpu_arm64.go cpu_arm64.s cpu_darwin_arm64.go cpu_darwin_arm64_other.go cpu_darwin_x86.go cpu_gc_arm64.go cpu_gc_s390x.go cpu_gc_x86.go cpu_gc_x86.s cpu_gccgo_arm64.go cpu_gccgo_s390x.go cpu_gccgo_x86.c cpu_gccgo_x86.go cpu_linux.go cpu_linux_arm.go cpu_linux_arm64.go cpu_linux_loong64.go cpu_linux_mips64x.go cpu_linux_noinit.go cpu_linux_ppc64x.go cpu_linux_riscv64.go cpu_linux_s390x.go cpu_loong64.go cpu_loong64.s cpu_mips64x.go cpu_mipsx.go cpu_netbsd_arm64.go cpu_openbsd_arm64.go cpu_openbsd_arm64.s cpu_other_arm.go cpu_other_arm64.go cpu_other_mips64x.go cpu_other_ppc64x.go cpu_other_riscv64.go cpu_other_x86.go cpu_ppc64x.go cpu_riscv64.go cpu_s390x.go cpu_s390x.s cpu_wasm.go cpu_x86.go cpu_zos.go cpu_zos_s390x.go endian_big.go endian_little.go hwcap_linux.go parse.go proc_cpuinfo_linux.go runtime_auxv.go runtime_auxv_go121.go syscall_aix_gccgo.go syscall_aix_ppc64_gc.go syscall_darwin_arm64_gc.go syscall_darwin_x86_gc.gounix
.gitignore README.md affinity_linux.go aliases.go asm_aix_ppc64.s asm_bsd_386.s asm_bsd_amd64.s asm_bsd_arm.s asm_bsd_arm64.s asm_bsd_ppc64.s asm_bsd_riscv64.s asm_linux_386.s asm_linux_amd64.s asm_linux_arm.s asm_linux_arm64.s asm_linux_loong64.s asm_linux_mips64x.s asm_linux_mipsx.s asm_linux_ppc64x.s asm_linux_riscv64.s asm_linux_s390x.s asm_openbsd_mips64.s asm_solaris_amd64.s asm_zos_s390x.s auxv.go auxv_unsupported.go bluetooth_linux.go bpxsvc_zos.go bpxsvc_zos.s cap_freebsd.go constants.go dev_aix_ppc.go dev_aix_ppc64.go dev_darwin.go dev_dragonfly.go dev_freebsd.go dev_linux.go dev_netbsd.go dev_openbsd.go dev_zos.go dirent.go endian_big.go endian_little.go env_unix.go fcntl.go fcntl_darwin.go fcntl_linux_32bit.go fdset.go gccgo.go gccgo_c.c gccgo_linux_amd64.go ifreq_linux.go ioctl_linux.go ioctl_signed.go ioctl_unsigned.go ioctl_zos.go mkall.sh mkerrors.sh mmap_nomremap.go mremap.go pagesize_unix.go pledge_openbsd.go ptrace_darwin.go ptrace_ios.go race.go race0.go readdirent_getdents.go readdirent_getdirentries.go sockcmsg_dragonfly.go sockcmsg_linux.go sockcmsg_unix.go sockcmsg_unix_other.go sockcmsg_zos.go symaddr_zos_s390x.s syscall.go syscall_aix.go syscall_aix_ppc.go syscall_aix_ppc64.go syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go syscall_darwin_arm64.go syscall_darwin_libSystem.go syscall_dragonfly.go syscall_dragonfly_amd64.go syscall_freebsd.go syscall_freebsd_386.go syscall_freebsd_amd64.go syscall_freebsd_arm.go syscall_freebsd_arm64.go syscall_freebsd_riscv64.go syscall_hurd.go syscall_hurd_386.go syscall_illumos.go syscall_linux.go syscall_linux_386.go syscall_linux_alarm.go syscall_linux_amd64.go syscall_linux_amd64_gc.go syscall_linux_arm.go syscall_linux_arm64.go syscall_linux_gc.go syscall_linux_gc_386.go syscall_linux_gc_arm.go syscall_linux_gccgo_386.go syscall_linux_gccgo_arm.go syscall_linux_loong64.go syscall_linux_mips64x.go syscall_linux_mipsx.go syscall_linux_ppc.go syscall_linux_ppc64x.go syscall_linux_riscv64.go syscall_linux_s390x.go syscall_linux_sparc64.go syscall_netbsd.go syscall_netbsd_386.go syscall_netbsd_amd64.go syscall_netbsd_arm.go syscall_netbsd_arm64.go syscall_openbsd.go syscall_openbsd_386.go syscall_openbsd_amd64.go syscall_openbsd_arm.go syscall_openbsd_arm64.go syscall_openbsd_libc.go syscall_openbsd_mips64.go syscall_openbsd_ppc64.go syscall_openbsd_riscv64.go syscall_solaris.go syscall_solaris_amd64.go syscall_unix.go syscall_unix_gc.go syscall_unix_gc_ppc64x.go syscall_zos_s390x.go sysvshm_linux.go sysvshm_unix.go sysvshm_unix_other.go timestruct.go unveil_openbsd.go vgetrandom_linux.go vgetrandom_unsupported.go xattr_bsd.go zerrors_aix_ppc.go zerrors_aix_ppc64.go zerrors_darwin_amd64.go zerrors_darwin_arm64.go zerrors_dragonfly_amd64.go zerrors_freebsd_386.go zerrors_freebsd_amd64.go zerrors_freebsd_arm.go zerrors_freebsd_arm64.go zerrors_freebsd_riscv64.go zerrors_linux.go zerrors_linux_386.go zerrors_linux_amd64.go zerrors_linux_arm.go zerrors_linux_arm64.go zerrors_linux_loong64.go zerrors_linux_mips.go zerrors_linux_mips64.go zerrors_linux_mips64le.go zerrors_linux_mipsle.go zerrors_linux_ppc.go zerrors_linux_ppc64.go zerrors_linux_ppc64le.go zerrors_linux_riscv64.go zerrors_linux_s390x.go zerrors_linux_sparc64.go zerrors_netbsd_386.go zerrors_netbsd_amd64.go zerrors_netbsd_arm.go zerrors_netbsd_arm64.go zerrors_openbsd_386.go zerrors_openbsd_amd64.go zerrors_openbsd_arm.go zerrors_openbsd_arm64.go zerrors_openbsd_mips64.go zerrors_openbsd_ppc64.go zerrors_openbsd_riscv64.go zerrors_solaris_amd64.go zerrors_zos_s390x.go zptrace_armnn_linux.go zptrace_linux_arm64.go zptrace_mipsnn_linux.go zptrace_mipsnnle_linux.go zptrace_x86_linux.go zsymaddr_zos_s390x.s zsyscall_aix_ppc.go zsyscall_aix_ppc64.go zsyscall_aix_ppc64_gc.go zsyscall_aix_ppc64_gccgo.go zsyscall_darwin_amd64.go zsyscall_darwin_amd64.s zsyscall_darwin_arm64.go zsyscall_darwin_arm64.s zsyscall_dragonfly_amd64.go zsyscall_freebsd_386.go zsyscall_freebsd_amd64.go zsyscall_freebsd_arm.go zsyscall_freebsd_arm64.go zsyscall_freebsd_riscv64.go zsyscall_illumos_amd64.go zsyscall_linux.go zsyscall_linux_386.go zsyscall_linux_amd64.go zsyscall_linux_arm.go zsyscall_linux_arm64.go zsyscall_linux_loong64.go zsyscall_linux_mips.go zsyscall_linux_mips64.go zsyscall_linux_mips64le.go zsyscall_linux_mipsle.go zsyscall_linux_ppc.go zsyscall_linux_ppc64.go zsyscall_linux_ppc64le.go zsyscall_linux_riscv64.go zsyscall_linux_s390x.go zsyscall_linux_sparc64.go zsyscall_netbsd_386.go zsyscall_netbsd_amd64.go zsyscall_netbsd_arm.go zsyscall_netbsd_arm64.go zsyscall_openbsd_386.go zsyscall_openbsd_386.s zsyscall_openbsd_amd64.go zsyscall_openbsd_amd64.s zsyscall_openbsd_arm.go zsyscall_openbsd_arm.s zsyscall_openbsd_arm64.go zsyscall_openbsd_arm64.s zsyscall_openbsd_mips64.go zsyscall_openbsd_mips64.s zsyscall_openbsd_ppc64.go zsyscall_openbsd_ppc64.s zsyscall_openbsd_riscv64.go zsyscall_openbsd_riscv64.s zsyscall_solaris_amd64.go zsyscall_zos_s390x.go zsysctl_openbsd_386.go zsysctl_openbsd_amd64.go zsysctl_openbsd_arm.go zsysctl_openbsd_arm64.go zsysctl_openbsd_mips64.go zsysctl_openbsd_ppc64.go zsysctl_openbsd_riscv64.go zsysnum_darwin_amd64.go zsysnum_darwin_arm64.go zsysnum_dragonfly_amd64.go zsysnum_freebsd_386.go zsysnum_freebsd_amd64.go zsysnum_freebsd_arm.go zsysnum_freebsd_arm64.go zsysnum_freebsd_riscv64.go zsysnum_linux_386.go zsysnum_linux_amd64.go zsysnum_linux_arm.go zsysnum_linux_arm64.go zsysnum_linux_loong64.go zsysnum_linux_mips.go zsysnum_linux_mips64.go zsysnum_linux_mips64le.go zsysnum_linux_mipsle.go zsysnum_linux_ppc.go zsysnum_linux_ppc64.go zsysnum_linux_ppc64le.go zsysnum_linux_riscv64.go zsysnum_linux_s390x.go zsysnum_linux_sparc64.go zsysnum_netbsd_386.go zsysnum_netbsd_amd64.go zsysnum_netbsd_arm.go zsysnum_netbsd_arm64.go zsysnum_openbsd_386.go zsysnum_openbsd_amd64.go zsysnum_openbsd_arm.go zsysnum_openbsd_arm64.go zsysnum_openbsd_mips64.go zsysnum_openbsd_ppc64.go zsysnum_openbsd_riscv64.go zsysnum_zos_s390x.go ztypes_aix_ppc.go ztypes_aix_ppc64.go ztypes_darwin_amd64.go ztypes_darwin_arm64.go ztypes_dragonfly_amd64.go ztypes_freebsd_386.go ztypes_freebsd_amd64.go ztypes_freebsd_arm.go ztypes_freebsd_arm64.go ztypes_freebsd_riscv64.go ztypes_linux.go ztypes_linux_386.go ztypes_linux_amd64.go ztypes_linux_arm.go ztypes_linux_arm64.go ztypes_linux_loong64.go ztypes_linux_mips.go ztypes_linux_mips64.go ztypes_linux_mips64le.go ztypes_linux_mipsle.go ztypes_linux_ppc.go ztypes_linux_ppc64.go ztypes_linux_ppc64le.go ztypes_linux_riscv64.go ztypes_linux_s390x.go ztypes_linux_sparc64.go ztypes_netbsd_386.go ztypes_netbsd_amd64.go ztypes_netbsd_arm.go ztypes_netbsd_arm64.go ztypes_openbsd_386.go ztypes_openbsd_amd64.go ztypes_openbsd_arm.go ztypes_openbsd_arm64.go ztypes_openbsd_mips64.go ztypes_openbsd_ppc64.go ztypes_openbsd_riscv64.go ztypes_solaris_amd64.go ztypes_zos_s390x.gowindows
aliases.go dll_windows.go env_windows.go eventlog.go exec_windows.go memory_windows.go mkerrors.bash mkknownfolderids.bash mksyscall.go race.go race0.go security_windows.go service.go setupapi_windows.go str.go syscall.go syscall_windows.go types_windows.go types_windows_386.go types_windows_amd64.go types_windows_arm.go types_windows_arm64.go zerrors_windows.go zknownfolderids_windows.go zsyscall_windows.goviews
blob.html commit.html files.html footer.html license.html markers.html nav-main.html nav-repository.html readme.html repositories.html repository.html tree.html
vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
raw
1// Copyright 2009 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5//go:build amd64 && linux
6
7package unix
8
9//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
10//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
11//sys Fchown(fd int, uid int, gid int) (err error)
12//sys Fstat(fd int, stat *Stat_t) (err error)
13//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
14//sys Fstatfs(fd int, buf *Statfs_t) (err error)
15//sys Ftruncate(fd int, length int64) (err error)
16//sysnb Getegid() (egid int)
17//sysnb Geteuid() (euid int)
18//sysnb Getgid() (gid int)
19//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
20//sysnb Getuid() (uid int)
21//sys Ioperm(from int, num int, on int) (err error)
22//sys Iopl(level int) (err error)
23//sys Lchown(path string, uid int, gid int) (err error)
24//sys Listen(s int, n int) (err error)
25
26func Lstat(path string, stat *Stat_t) (err error) {
27 return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW)
28}
29
30//sys MemfdSecret(flags int) (fd int, err error)
31//sys Pause() (err error)
32//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
33//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
34//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
35//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
36
37func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
38 var ts *Timespec
39 if timeout != nil {
40 ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
41 }
42 return pselect6(nfd, r, w, e, ts, nil)
43}
44
45//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
46//sys setfsgid(gid int) (prev int, err error)
47//sys setfsuid(uid int) (prev int, err error)
48//sys Shutdown(fd int, how int) (err error)
49//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
50
51func Stat(path string, stat *Stat_t) (err error) {
52 // Use fstatat, because Android's seccomp policy blocks stat.
53 return Fstatat(AT_FDCWD, path, stat, 0)
54}
55
56//sys Statfs(path string, buf *Statfs_t) (err error)
57//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
58//sys Truncate(path string, length int64) (err error)
59//sys Ustat(dev int, ubuf *Ustat_t) (err error)
60//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
61//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
62//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
63//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
64//sysnb setgroups(n int, list *_Gid_t) (err error)
65//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
66//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
67//sysnb socket(domain int, typ int, proto int) (fd int, err error)
68//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
69//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
70//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
71//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
72//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
73//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
74//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
75//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
76
77//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
78
79func Gettimeofday(tv *Timeval) (err error) {
80 errno := gettimeofday(tv)
81 if errno != 0 {
82 return errno
83 }
84 return nil
85}
86
87func Time(t *Time_t) (tt Time_t, err error) {
88 var tv Timeval
89 errno := gettimeofday(&tv)
90 if errno != 0 {
91 return 0, errno
92 }
93 if t != nil {
94 *t = Time_t(tv.Sec)
95 }
96 return Time_t(tv.Sec), nil
97}
98
99//sys Utime(path string, buf *Utimbuf) (err error)
100//sys utimes(path string, times *[2]Timeval) (err error)
101
102func setTimespec(sec, nsec int64) Timespec {
103 return Timespec{Sec: sec, Nsec: nsec}
104}
105
106func setTimeval(sec, usec int64) Timeval {
107 return Timeval{Sec: sec, Usec: usec}
108}
109
110func (r *PtraceRegs) PC() uint64 { return r.Rip }
111
112func (r *PtraceRegs) SetPC(pc uint64) { r.Rip = pc }
113
114func (iov *Iovec) SetLen(length int) {
115 iov.Len = uint64(length)
116}
117
118func (msghdr *Msghdr) SetControllen(length int) {
119 msghdr.Controllen = uint64(length)
120}
121
122func (msghdr *Msghdr) SetIovlen(length int) {
123 msghdr.Iovlen = uint64(length)
124}
125
126func (cmsg *Cmsghdr) SetLen(length int) {
127 cmsg.Len = uint64(length)
128}
129
130func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
131 rsa.Service_name_len = uint64(length)
132}
133
134//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error)
135
136func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error {
137 cmdlineLen := len(cmdline)
138 if cmdlineLen > 0 {
139 // Account for the additional NULL byte added by
140 // BytePtrFromString in kexecFileLoad. The kexec_file_load
141 // syscall expects a NULL-terminated string.
142 cmdlineLen++
143 }
144 return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
145}