aboutsummaryrefslogtreecommitdiff
path: root/libgo/sysinfo.c
AgeCommit message (Collapse)AuthorFilesLines
2018-06-22syscall: remove UstatIan Lance Taylor1-3/+0
glibc 2.28 removes ustat.h and the ustat function entirely, which breaks syscall.Ustat. Updates golang/go#25990 Reviewed-on: https://go-review.googlesource.com/120535 From-SVN: r261896
2018-05-02libgo: add type/const references to sysinfo.cIan Lance Taylor1-0/+209
This patch adds explicit references to various types and constants defined by the header files included by sysinfo.c (used to drive the generation of gen-sysinfo.go as part of the libgo build via the GCC "-fdump-go-spec" option). The intent is to enable clients to gather the same info generated by "-fdump-go-spec" by instead reading the generated DWARF from a sysinfo.o object file compiled with "-g". Some compilers (notably clang) try to omit DWARF records for a given type unless there is an explicit use of it in the translation unit; the additional references are to insure that everything we want to see in the DWARF shows up. Reviewed-on: https://go-review.googlesource.com/99063 From-SVN: r259868
2017-07-18re PR go/81324 (libgo does not build with glibc 2.18)Ian Lance Taylor1-0/+4
PR go/81324 sysinfo.c: ignore ptrace_peeksiginfo_args from <linux/ptrace.h> With some versions of glibc and GNU/Linux ptrace_pseeksiginfo_args is defined in both <sys/ptrace.h> and <linux/ptrace.h>. We don't actually care about the struct, so use a #define to avoid a redefinition error. This fixes https://gcc.gnu.org/PR81324. Reviewed-on: https://go-review.googlesource.com/49290 From-SVN: r250324
2017-06-26libgo: redefine ia64 struct names around linux/ptrace.hIan Lance Taylor1-0/+5
Avoid https://sourceware.org/bugzilla/show_bug.cgi?id=762. Patch by Andreas Schwab. Reviewed-on: https://go-review.googlesource.com/46711 From-SVN: r249662
2017-06-21libgo, syscall: fix ptrace implementation on MIPSIan Lance Taylor1-0/+3
On MIPS, the correct structure for PtraceRegs is 'struct pt_regs' which is declared in linux/ptrace.h. Previously no PtraceRegs structure was created on MIPS because 'struct user_regs_struct' doesn't exist there. Fallback to using pt_regs when the PtraceRegs structure is generated in mksysinfo.sh, then adjust syscall_linux_mipsx.go to read the program counter from the correct field. In addition, implement PtraceGetRegs and PtraceSetRegs on all 3 ABI variants. syscall_linux_mips64x.go can now be removed since the ptrace code on all 3 ABIs is identical. Reviewed-on: https://go-review.googlesource.com/46150 From-SVN: r249472
2016-11-18runtime, reflect: rewrite Go to FFI type conversion in GoIan Lance Taylor1-0/+4
As we move toward the Go 1.7 garbage collector, it's essential that all allocation of values that can contain Go pointers be done using the correct type descriptor. That is simplest if we do all such allocation in Go code. This rewrites the code that converts from a Go type to a libffi CIF into Go. Reviewed-on: https://go-review.googlesource.com/33353 From-SVN: r242578
2016-10-18runtime: copy netpoll code from Go 1.7 runtimeIan Lance Taylor1-0/+13
Reviewed-on: https://go-review.googlesource.com/31325 From-SVN: r241307
2016-09-30runtime: copy internal locking code from Go 1.7 runtimeIan Lance Taylor1-0/+3
Remove the old locking code written in C. Add a shell script mkrsysinfo.sh to generate the runtime_sysinfo.go file, so that we can get Go copies of the system time structures and other types. Tweak the compiler so that when compiling the runtime package the address operator does not cause local variables to escape. When the gc compiler compiles the runtime, an escaping local variable is treated as an error. We should implement that, instead of this change, when escape analysis is turned on. Tweak the compiler so that the generated C header does not include names that start with an underscore followed by a non-upper-case letter, except for the special cases of _defer and _panic. Otherwise we translate C types to Go in runtime_sysinfo.go and then generate those Go types back as C types in runtime.inc, which is useless and painful for the C code. Change entersyscall and friends to take a dummy argument, as the gc versions do, to simplify calls from the shared code. Reviewed-on: https://go-review.googlesource.com/30079 From-SVN: r240657
2016-09-27libgo: separate mksysinfo inputs into separate Makefile targetsIan Lance Taylor1-0/+259
This is a step toward a version of mksysinfo that generates information for the runtime package. This will be used to generate the runtime_sysinfo.go file, which is currently directly generated by a Makefile target. Reviewed-on: https://go-review.googlesource.com/29683 From-SVN: r240560