// Must be called with option.Config.EnablePolicyMU locked.
774001
func (d *Daemon) writePreFilterHeader(dir string) error {
	headerPath := filepath.Join(dir, common.PreFilterHeaderFileName)
	log.WithField(logfields.Path, headerPath).Debug("writing configuration")
	f, err := os.Create(headerPath)
	if err != nil {
		return fmt.Errorf("failed to open file %s for writing: %s", headerPath, err)

	}
	defer f.Close()
	fw := bufio.NewWriter(f)
	fmt.Fprint(fw, "/*\n")
	fmt.Fprintf(fw, " * XDP device: %s\n", option.Config.DevicePreFilter)
	fmt.Fprintf(fw, " * XDP mode: %s\n", option.Config.ModePreFilter)
	fmt.Fprint(fw, " */\n\n")
	d.preFilter.WriteConfig(fw)
	return fw.Flush()
}
297397
func (p *PWMPin) Enable(enable bool) (err error) {
	if p.enabled != enable {
		p.enabled = enable
		enableVal := 0
		if enable {
			enableVal = 1
		}
		_, err = p.write(p.pwmEnablePath(), []byte(fmt.Sprintf("%v", enableVal)))
	}
	return
}
659590
func Enabled(n FeatureFlag) bool {
	fMu.RLock()
	defer fMu.RUnlock()
	v, present := features[n]
	if !present {
		panic(fmt.Sprintf("feature '%s' doesn't exist", n.String()))
	}
	return v
}
112441
func SupportedOption(option uint16) bool {
	sup.RLock()
	_, ok := sup.m[option]
	sup.RUnlock()
	return ok
}
1375026
func (c *Sys) EnableAudit(
	path string, auditType string, desc string, opts map[string]string) error {
	return c.EnableAuditWithOptions(path, &EnableAuditOptions{
		Type:        auditType,
		Description: desc,
		Options:     opts,
	})
}
1270252
func (c *Context) IsEnabled(capability int) bool {
	return c.Call("isEnabled", capability).Bool()
}
427106
func (d *domainClient) SetVirtualTimePolicy(ctx context.Context, args *SetVirtualTimePolicyArgs) (reply *SetVirtualTimePolicyReply, err error) {
	reply = new(SetVirtualTimePolicyReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Emulation.setVirtualTimePolicy", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Emulation.setVirtualTimePolicy", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Emulation", Op: "SetVirtualTimePolicy", Err: err}
	}
	return
}
604983
func (s *DistributionConfig) SetIsIPV6Enabled(v bool) *DistributionConfig {
	s.IsIPV6Enabled = &v
	return s
}
898220
func (c *Client) EnablePlugin(opts EnablePluginOptions) error {
	path := "/plugins/" + opts.Name + "/enable?" + queryString(opts)
	resp, err := c.do("POST", path, doOptions{context: opts.Context})
	defer resp.Body.Close()
	if err != nil {
		return err
	}
	resp.Body.Close()
	return nil
}
1028231
func (e *Endpoint) applyOptsLocked(opts option.OptionMap) bool {
	changed := e.Options.ApplyValidated(opts, optionChanged, e) > 0
	_, exists := opts[option.Debug]
	if exists && changed {
		e.UpdateLogger(nil)
	}
	return changed
}
1202596
func (m *CorsPolicy) GetEnabled() *types.BoolValue {
	if x, ok := m.GetEnabledSpecifier().(*CorsPolicy_Enabled); ok {
		return x.Enabled
	}
	return nil
}
472197
func EnableFastMode(ctx context.Context) context.Context {
	return context.WithValue(ctx, ctxFastModeKey{}, true)
}
810761
func Enable() {
	go func() {
		if err := http.ListenAndServe(apiAddress, nil); err != nil {
			log.WithError(err).Warn("Unable to serve pprof API")
		}
	}()
}
853765
func (pm *Manager) Disable(name string, config *types.PluginDisableConfig) error {
	return errNotSupported
}
343143
func IsEnabled() bool {
	enabled := false
	// Check if Seccomp is supported, via CONFIG_SECCOMP.
	if err := unix.Prctl(unix.PR_GET_SECCOMP, 0, 0, 0, 0); err != unix.EINVAL {
		// Make sure the kernel has CONFIG_SECCOMP_FILTER.
		if err := unix.Prctl(unix.PR_SET_SECCOMP, unix.SECCOMP_MODE_FILTER, 0, 0, 0); err != unix.EINVAL {
			enabled = true
		}
	}
	logrus.Debugf("seccomp status: %v", enabled)
	return enabled
}
18692
func (v *vaultClient) Enabled() bool {
	v.l.Lock()
	defer v.l.Unlock()
	return v.config.IsEnabled()
}
711425
func (r Hardware_SecurityModule750) ToggleManagementInterface(enabled *bool) (resp bool, err error) {
	params := []interface{}{
		enabled,
	}
	err = r.Session.DoRequest("SoftLayer_Hardware_SecurityModule750", "toggleManagementInterface", params, &r.Options, &resp)
	return
}