---
name: "bsde_get_rule_count"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/bsde_get_rule_count"
---

# bsde\_get\_rule\_count(3)

file system firewall statistics

## NAME

**bsde\_get\_rule\_count**, **bsde\_get\_rule\_slots** – file system firewall statistics

## LIBRARY

library “libugidfw”

## SYNOPSIS

**#include \<ugidfw.h\>**

*int*\

**bsde\_get\_rule\_count**(*size\_t errlen*, *char \*errstr*);

*int*\

**bsde\_get\_rule\_slots**(*size\_t errlen*, *char \*errstr*);

## DESCRIPTION

The **bsde\_get\_rule\_count**() and **bsde\_get\_rule\_slots**() functions return the total number of enforced rules and the total number of used rule slots, respectively. If an error occurs, *\*errstr* is filled in with the error string (up to *errlen* characters, including the terminating NUL).

## RETURN VALUES

The **bsde\_get\_rule\_count**() and **bsde\_get\_rule\_slots**() functions return the number of enforced rules and rule slots (respectively) if successful; otherwise the value -1 is returned and the value of *\*errstr* is filled in as documented in DESCRIPTION.

## SEE ALSO

[bsde\_delete\_rule(3)](/bsde_delete_rule/3.md), [bsde\_get\_rule(3)](/bsde_get_rule/3.md), [bsde\_parse\_rule(3)](/bsde_parse_rule/3.md), [bsde\_parse\_rule\_string(3)](/bsde_parse_rule_string/3.md), [bsde\_rule\_to\_string(3)](/bsde_rule_to_string/3.md), [bsde\_set\_rule(3)](/bsde_set_rule/3.md), [libugidfw(3)](/libugidfw/3.md), [mac\_bsdextended(4)](/mac_bsdextended/4.md), [ugidfw(8)](/ugidfw/8.md)

## AUTHORS

This software was contributed to the FreeBSD Project by Network Associates Labs, the Security Research Division of Network Associates Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (“CBOSS”), as part of the DARPA CHATS research program.
