From 15128d47bd7de318bea5ecf0fb15a45deb794c9d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 11 Jan 2016 22:16:14 +0100 Subject: sys: support /dev/snd/seq --- sys/decl.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sys/decl.go') diff --git a/sys/decl.go b/sys/decl.go index ea361f440..9476c5c3c 100644 --- a/sys/decl.go +++ b/sys/decl.go @@ -102,6 +102,7 @@ const ( FdKvm FdKvmVm FdKvmCpu + FdSndSeq IPCMsq IPCSem @@ -131,7 +132,7 @@ func ResourceSubkinds(kind ResourceKind) []ResourceSubkind { FdDRI, FdFuse, FdKdbus, FdBpfMap, FdBpfProg, FdPerf, FdUserFault, FdAlg, FdAlgConn, FdNfcRaw, FdNfcLlcp, FdBtHci, FdBtSco, FdBtL2cap, FdBtRfcomm, FdBtHidp, FdBtCmtp, FdBtBnep, FdUnix, FdSctp, FdKvm, FdKvmVm, - FdKvmCpu} + FdKvmCpu, FdSndSeq} case ResIPC: return []ResourceSubkind{IPCMsq, IPCSem, IPCShm} case ResIOCtx, ResKey, ResInotifyDesc, ResPid, ResUid, ResGid, ResTimerid, ResIocbPtr: @@ -457,13 +458,17 @@ func (t StructType) Align() uintptr { type UnionType struct { TypeCommon Options []Type + varlen bool } func (t UnionType) Size() uintptr { + if t.varlen { + panic("union size is not statically known") + } size := t.Options[0].Size() for _, opt := range t.Options { - if size != opt.Size() { - panic("union size is not statically known") + if size < opt.Size() { + size = opt.Size() } } return size -- cgit mrf-deployment