public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kallisti5 at unixzen dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/113143] Remove usage of ucontext.h
Date: Wed, 27 Dec 2023 02:34:27 +0000	[thread overview]
Message-ID: <bug-113143-4-9SVaVDhFQZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113143-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113143

--- Comment #6 from Alexander von Gluck <kallisti5 at unixzen dot com> ---
For added clairity. Searching the upstream go sources:

```
 grep -R getcontext
src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go:// getcontext
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go:    SYS_GETCONTEXT 
             = 421 // { int getcontext(struct __ucontext *ucp); }
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go:  SYS_GETCONTEXT 
             = 421 // { int getcontext(struct __ucontext *ucp); }
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go:    SYS_GETCONTEXT 
             = 421 // { int getcontext(struct __ucontext *ucp); }
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go:  SYS_GETCONTEXT 
             = 421 // { int getcontext(struct __ucontext *ucp); }
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go:     SYS_GETCONTEXT 
         = 307 // { int|sys||getcontext(struct __ucontext *ucp); }
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go:   SYS_GETCONTEXT 
         = 307 // { int|sys||getcontext(struct __ucontext *ucp); }
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go:     SYS_GETCONTEXT 
         = 307 // { int|sys||getcontext(struct __ucontext *ucp); }
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go:   SYS_GETCONTEXT 
         = 307 // { int|sys||getcontext(struct __ucontext *ucp); }
src/runtime/cgo/gcc_solaris_amd64.c:    if (getcontext(&ctx) != 0)
src/runtime/cgo/gcc_solaris_amd64.c:            perror("runtime/cgo: getcontext
failed");
src/runtime/os3_solaris.go://go:cgo_import_dynamic libc_getcontext getcontext
"libc.so"
src/runtime/os3_solaris.go://go:linkname libc_getcontext libc_getcontext
src/runtime/os3_solaris.go:     libc_getcontext,
src/runtime/os3_solaris.go:func getcontext(context *ucontext) /* int32 */ {
src/runtime/os3_solaris.go:     sysvicall1(&libc_getcontext,
uintptr(unsafe.Pointer(context)))
src/runtime/os_netbsd.go:func getcontext(ctxt unsafe.Pointer)
src/runtime/os_netbsd.go:       getcontext(unsafe.Pointer(&uc))
src/runtime/sys_netbsd_386.s:#define SYS_getcontext                     307
src/runtime/sys_netbsd_386.s:TEXT runtime·getcontext(SB),NOSPLIT,$-4
src/runtime/sys_netbsd_386.s:   MOVL    $SYS_getcontext, AX
src/runtime/sys_netbsd_amd64.s:#define SYS_getcontext                   307
src/runtime/sys_netbsd_amd64.s:TEXT runtime·getcontext(SB),NOSPLIT,$-8
src/runtime/sys_netbsd_amd64.s: MOVL    $SYS_getcontext, AX
src/runtime/sys_netbsd_arm.s:#define SYS_getcontext                    
SWI_OS_NETBSD | 307
src/runtime/sys_netbsd_arm.s:TEXT runtime·getcontext(SB),NOSPLIT|NOFRAME,$0
src/runtime/sys_netbsd_arm.s:   SWI $SYS_getcontext
src/runtime/sys_netbsd_arm64.s:#define SYS_getcontext                   307
src/runtime/sys_netbsd_arm64.s:TEXT runtime·getcontext(SB),NOSPLIT,$-8
src/runtime/sys_netbsd_arm64.s: SVC     $SYS_getcontext
src/syscall/zsysnum_freebsd_386.go:     SYS_GETCONTEXT               = 421 // {
int getcontext(struct __ucontext *ucp); }
src/syscall/zsysnum_freebsd_amd64.go:   SYS_GETCONTEXT               = 421 // {
int getcontext(struct __ucontext *ucp); }
src/syscall/zsysnum_freebsd_arm.go:     SYS_GETCONTEXT               = 421 // {
int getcontext(struct __ucontext *ucp); }
src/syscall/zsysnum_freebsd_arm64.go:   SYS_GETCONTEXT               = 421 // {
int getcontext(struct __ucontext *ucp); }
src/syscall/zsysnum_netbsd_386.go:      SYS_GETCONTEXT           = 307 // {
int|sys||getcontext(struct __ucontext *ucp); }
src/syscall/zsysnum_netbsd_amd64.go:    SYS_GETCONTEXT           = 307 // {
int|sys||getcontext(struct __ucontext *ucp); }
src/syscall/zsysnum_netbsd_arm.go:      SYS_GETCONTEXT           = 307 // {
int|sys||getcontext(struct __ucontext *ucp); }
src/syscall/zsysnum_netbsd_arm64.go:    SYS_GETCONTEXT           = 307 // {
int|sys||getcontext(struct __ucontext *ucp); }
```

Those all appear to be BSD-specific references, unless i'm missing an
invocation of (get|set|swap)context somewhere?

  parent reply	other threads:[~2023-12-27  2:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26  3:43 [Bug go/113143] New: " kallisti5 at unixzen dot com
2023-12-26  3:48 ` [Bug go/113143] " kallisti5 at unixzen dot com
2023-12-26  4:48 ` ian at airs dot com
2023-12-26 13:13 ` kallisti5 at unixzen dot com
2023-12-26 23:16 ` ian at airs dot com
2023-12-27  2:31 ` kallisti5 at unixzen dot com
2023-12-27  2:34 ` kallisti5 at unixzen dot com [this message]
2023-12-27  2:40 ` pinskia at gcc dot gnu.org
2023-12-27  3:20 ` kallisti5 at unixzen dot com
2023-12-27  3:38 ` kallisti5 at unixzen dot com
2023-12-27 23:20 ` ian at airs dot com
2023-12-29  1:45 ` kallisti5 at unixzen dot com
2023-12-30  6:26 ` ian at airs dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113143-4-9SVaVDhFQZ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).