Skip to content

Commit

Permalink
Add more Stat members for Dragonfly.
Browse files Browse the repository at this point in the history
  • Loading branch information
djberg96 committed Jun 3, 2024
1 parent df56cdd commit 7dbcb93
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions lib/sys/unix/sys/filesystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,27 @@ class Stat
# The filesystem type, e.g. UFS.
attr_accessor :base_type

# The filesystem ID
attr_accessor :filesystem_id

# The filesystem type
attr_accessor :filesystem_type

# The user that mounted the filesystem
attr_accessor :owner

# Count of sync reads since mount
attr_accessor :sync_reads

# Count of sync writes since mount
attr_accessor :sync_writes

# Count of async reads since mount
attr_accessor :async_reads

# Count of async writes since mount
attr_accessor :async_writes

alias inodes files
alias inodes_free files_free
alias inodes_available files_available
Expand Down Expand Up @@ -250,6 +271,16 @@ def self.stat(path)
obj.base_type = fs[:f_basetype].to_s
end

# DragonFlyBSD has additional struct members
if RbConfig::CONFIG['host_os'] =~ /dragonfly/i
obj.owner = fs[:f_owner]
obj.filesystem_type = fs[:f_type]
obj.sync_reads= fs[:f_syncreads]
obj.async_reads= fs[:f_asyncreads]
obj.sync_writes = fs[:f_syncwrites]
obj.async_writes = fs[:f_asyncwrites]
end

obj.freeze
end

Expand Down

0 comments on commit 7dbcb93

Please sign in to comment.