xref: /aosp_15_r20/external/libcap/go/cgo-required.sh (revision 2810ac1b38eead2603277920c78344c84ddf3aff)
1*2810ac1bSKiyoung Kim#!/bin/bash
2*2810ac1bSKiyoung Kim#
3*2810ac1bSKiyoung Kim# Runtime check for whether or not syscall.AllThreadsSyscall is
4*2810ac1bSKiyoung Kim# available to the working go runtime or not. If it isn't we always
5*2810ac1bSKiyoung Kim# have to use libcap/psx to get POSIX semantics for syscalls that
6*2810ac1bSKiyoung Kim# change security state.
7*2810ac1bSKiyoung Kimif [ -n "$1" ]; then
8*2810ac1bSKiyoung Kim    export GO="${1}"
9*2810ac1bSKiyoung Kimelse
10*2810ac1bSKiyoung Kim    export GO=go
11*2810ac1bSKiyoung Kimfi
12*2810ac1bSKiyoung Kim
13*2810ac1bSKiyoung Kimif [ -z "$(${GO} doc syscall 2>/dev/null|grep AllThreadsSyscall)" ]; then
14*2810ac1bSKiyoung Kim    echo "1"
15*2810ac1bSKiyoung Kimelse
16*2810ac1bSKiyoung Kim    echo "0"
17*2810ac1bSKiyoung Kimfi
18