Skip to content

Instantly share code, notes, and snippets.

@hernad
Created December 7, 2008 09:44
Show Gist options
  • Save hernad/33073 to your computer and use it in GitHub Desktop.
Save hernad/33073 to your computer and use it in GitHub Desktop.
module Etc
class Passwd < FFI::Struct
@@@
struct do |s|
s.include "sys/types.h"
s.include "pwd.h"
s.name "struct passwd"
s.field :pw_name, :string
s.field :pw_passwd, :string
s.field :pw_uid, :uint
s.field :pw_gid, :uint
s.field :pw_dir, :string
s.field :pw_shell, :string
end
@@@
end
class Group < FFI::Struct
@@@
struct do |s|
s.include "sys/types.h"
s.include "grp.h"
s.name "struct group"
s.field :gr_name, :string
s.field :gr_gid, :uint
end
@@@
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment