summaryrefslogtreecommitdiffstats
path: root/contrib/go/_std_1.24/src/internal/syscall/unix/waitid_linux.go
blob: 240a7f744ce21fabf2eda2c207beee754b973b8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package unix

import (
	"syscall"
	"unsafe"
)

const (
	P_PID   = 1
	P_PIDFD = 3
)

func Waitid(idType int, id int, info *SiginfoChild, options int, rusage *syscall.Rusage) error {
	_, _, errno := syscall.Syscall6(syscall.SYS_WAITID, uintptr(idType), uintptr(id), uintptr(unsafe.Pointer(info)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0)
	if errno != 0 {
		return errno
	}
	return nil
}