func addWhitelist()

in cmd/seccomp-profiler/main.go [302:324]


func addWhitelist(archInfo *arch.Info, syscalls []string) ([]string, []string) {
	m := make(map[string]struct{}, len(syscalls))
	for _, s := range syscalls {
		m[s] = struct{}{}
	}

	var added []string
	for _, s := range allowList {
		if _, found := archInfo.SyscallNames[s]; found {
			_, found := m[s]
			if !found {
				m[s] = struct{}{}
				added = append(added, s)
			}
		}
	}

	out := make([]string, 0, len(m))
	for s := range m {
		out = append(out, s)
	}
	return out, added
}