| 1 |
// Copyright 2019 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 |
// Linux system call wrappers that provide POSIX semantics through the |
| 6 |
// corresponding cgo->libc (nptl) wrappers for various system calls. |
| 7 |
|
| 8 |
//go:build linux |
| 9 |
|
| 10 |
package cgo |
| 11 |
|
| 12 |
import "unsafe" |
| 13 |
|
| 14 |
// Each of the following entries is needed to ensure that the |
| 15 |
// syscall.syscall_linux code can conditionally call these |
| 16 |
// function pointers: |
| 17 |
// |
| 18 |
// 1. find the C-defined function start |
| 19 |
// 2. force the local byte alias to be mapped to that location |
| 20 |
// 3. map the Go pointer to the function to the syscall package |
| 21 |
|
| 22 |
//go:cgo_import_static _cgo_libc_setegid |
| 23 |
//go:linkname _cgo_libc_setegid _cgo_libc_setegid |
| 24 |
//go:linkname cgo_libc_setegid syscall.cgo_libc_setegid |
| 25 |
var _cgo_libc_setegid byte |
| 26 |
var cgo_libc_setegid = unsafe.Pointer(&_cgo_libc_setegid) |
| 27 |
|
| 28 |
//go:cgo_import_static _cgo_libc_seteuid |
| 29 |
//go:linkname _cgo_libc_seteuid _cgo_libc_seteuid |
| 30 |
//go:linkname cgo_libc_seteuid syscall.cgo_libc_seteuid |
| 31 |
var _cgo_libc_seteuid byte |
| 32 |
var cgo_libc_seteuid = unsafe.Pointer(&_cgo_libc_seteuid) |
| 33 |
|
| 34 |
//go:cgo_import_static _cgo_libc_setregid |
| 35 |
//go:linkname _cgo_libc_setregid _cgo_libc_setregid |
| 36 |
//go:linkname cgo_libc_setregid syscall.cgo_libc_setregid |
| 37 |
var _cgo_libc_setregid byte |
| 38 |
var cgo_libc_setregid = unsafe.Pointer(&_cgo_libc_setregid) |
| 39 |
|
| 40 |
//go:cgo_import_static _cgo_libc_setresgid |
| 41 |
//go:linkname _cgo_libc_setresgid _cgo_libc_setresgid |
| 42 |
//go:linkname cgo_libc_setresgid syscall.cgo_libc_setresgid |
| 43 |
var _cgo_libc_setresgid byte |
| 44 |
var cgo_libc_setresgid = unsafe.Pointer(&_cgo_libc_setresgid) |
| 45 |
|
| 46 |
//go:cgo_import_static _cgo_libc_setresuid |
| 47 |
//go:linkname _cgo_libc_setresuid _cgo_libc_setresuid |
| 48 |
//go:linkname cgo_libc_setresuid syscall.cgo_libc_setresuid |
| 49 |
var _cgo_libc_setresuid byte |
| 50 |
var cgo_libc_setresuid = unsafe.Pointer(&_cgo_libc_setresuid) |
| 51 |
|
| 52 |
//go:cgo_import_static _cgo_libc_setreuid |
| 53 |
//go:linkname _cgo_libc_setreuid _cgo_libc_setreuid |
| 54 |
//go:linkname cgo_libc_setreuid syscall.cgo_libc_setreuid |
| 55 |
var _cgo_libc_setreuid byte |
| 56 |
var cgo_libc_setreuid = unsafe.Pointer(&_cgo_libc_setreuid) |
| 57 |
|
| 58 |
//go:cgo_import_static _cgo_libc_setgroups |
| 59 |
//go:linkname _cgo_libc_setgroups _cgo_libc_setgroups |
| 60 |
//go:linkname cgo_libc_setgroups syscall.cgo_libc_setgroups |
| 61 |
var _cgo_libc_setgroups byte |
| 62 |
var cgo_libc_setgroups = unsafe.Pointer(&_cgo_libc_setgroups) |
| 63 |
|
| 64 |
//go:cgo_import_static _cgo_libc_setgid |
| 65 |
//go:linkname _cgo_libc_setgid _cgo_libc_setgid |
| 66 |
//go:linkname cgo_libc_setgid syscall.cgo_libc_setgid |
| 67 |
var _cgo_libc_setgid byte |
| 68 |
var cgo_libc_setgid = unsafe.Pointer(&_cgo_libc_setgid) |
| 69 |
|
| 70 |
//go:cgo_import_static _cgo_libc_setuid |
| 71 |
//go:linkname _cgo_libc_setuid _cgo_libc_setuid |
| 72 |
//go:linkname cgo_libc_setuid syscall.cgo_libc_setuid |
| 73 |
var _cgo_libc_setuid byte |
| 74 |
var cgo_libc_setuid = unsafe.Pointer(&_cgo_libc_setuid) |