mirror of
https://github.com/golang/sys.git
synced 2026-01-29 07:02:06 +03:00
windows: use GOARCH-specific JOBOBJECT_BASIC_LIMIT_INFORMATION
The Windows compilers appear to align JOBOBJECT_BASIC_LIMIT_INFORMATION to an 8-byte boundary, which on 32-bit systems means adding 32 bits of padding. Unfortunately we can't always add a padding field, because no padding is required on a 64-bit system. So use different versions of the struct for different targets. Fixes golang/go#41001 Change-Id: I38d14edfd3f3a80da22825455f20e1f7de136638 Reviewed-on: https://go-review.googlesource.com/c/sys/+/251197 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Marc-Antoine Ruel <maruel@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
This commit is contained in:
@@ -1584,18 +1584,6 @@ const (
|
||||
JOB_OBJECT_LIMIT_WORKINGSET = 0x00000001
|
||||
)
|
||||
|
||||
type JOBOBJECT_BASIC_LIMIT_INFORMATION struct {
|
||||
PerProcessUserTimeLimit int64
|
||||
PerJobUserTimeLimit int64
|
||||
LimitFlags uint32
|
||||
MinimumWorkingSetSize uintptr
|
||||
MaximumWorkingSetSize uintptr
|
||||
ActiveProcessLimit uint32
|
||||
Affinity uintptr
|
||||
PriorityClass uint32
|
||||
SchedulingClass uint32
|
||||
}
|
||||
|
||||
type IO_COUNTERS struct {
|
||||
ReadOperationCount uint64
|
||||
WriteOperationCount uint64
|
||||
|
||||
@@ -20,3 +20,16 @@ type Servent struct {
|
||||
Port uint16
|
||||
Proto *byte
|
||||
}
|
||||
|
||||
type JOBOBJECT_BASIC_LIMIT_INFORMATION struct {
|
||||
PerProcessUserTimeLimit int64
|
||||
PerJobUserTimeLimit int64
|
||||
LimitFlags uint32
|
||||
MinimumWorkingSetSize uintptr
|
||||
MaximumWorkingSetSize uintptr
|
||||
ActiveProcessLimit uint32
|
||||
Affinity uintptr
|
||||
PriorityClass uint32
|
||||
SchedulingClass uint32
|
||||
_ uint32 // pad to 8 byte boundary
|
||||
}
|
||||
|
||||
@@ -20,3 +20,15 @@ type Servent struct {
|
||||
Proto *byte
|
||||
Port uint16
|
||||
}
|
||||
|
||||
type JOBOBJECT_BASIC_LIMIT_INFORMATION struct {
|
||||
PerProcessUserTimeLimit int64
|
||||
PerJobUserTimeLimit int64
|
||||
LimitFlags uint32
|
||||
MinimumWorkingSetSize uintptr
|
||||
MaximumWorkingSetSize uintptr
|
||||
ActiveProcessLimit uint32
|
||||
Affinity uintptr
|
||||
PriorityClass uint32
|
||||
SchedulingClass uint32
|
||||
}
|
||||
|
||||
@@ -20,3 +20,16 @@ type Servent struct {
|
||||
Port uint16
|
||||
Proto *byte
|
||||
}
|
||||
|
||||
type JOBOBJECT_BASIC_LIMIT_INFORMATION struct {
|
||||
PerProcessUserTimeLimit int64
|
||||
PerJobUserTimeLimit int64
|
||||
LimitFlags uint32
|
||||
MinimumWorkingSetSize uintptr
|
||||
MaximumWorkingSetSize uintptr
|
||||
ActiveProcessLimit uint32
|
||||
Affinity uintptr
|
||||
PriorityClass uint32
|
||||
SchedulingClass uint32
|
||||
_ uint32 // pad to 8 byte boundary
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user