1234567891011121314151617181920212223242526272829(* This file is part of Luv, released under the MIT license. See LICENSE.md for
details, or visit https://github.com/aantron/luv/blob/master/LICENSE.md. *)typet={username:string;uid:Unsigned.ulong;gid:Unsigned.ulong;shell:stringoption;homedir:string;}letget_passwd()=letc_passwd=Ctypes.makeC.Types.Passwd.tinC.Functions.Passwd.get_passwd(Ctypes.addrc_passwd)|>Error.to_result_lazybeginfun()->letmodulePW=C.Types.Passwdinletpasswd={username=Ctypes.getfc_passwdPW.username;uid=Ctypes.getfc_passwdPW.uid;gid=Ctypes.getfc_passwdPW.gid;shell=Ctypes.getfc_passwdPW.shell;homedir=Ctypes.getfc_passwdPW.homedir;}inC.Functions.Passwd.free(Ctypes.addrc_passwd);passwdend