Handbook
Glossary
group-list ( name gid -- groups )
Vocabulary
unix
.
groups
.
private
Inputs
name
an
object
gid
an
object
Outputs
groups
an
object
Definition
USING:
alien.c-types
alien.data
byte-arrays
kernel
libc
math
unix.ffi
unix.types
;
IN:
unix.groups.private
::
group-list
( name gid -- groups )
64
:>
capacity!
f
:>
groups!
[
capacity
gid_t
heap-size
*
<byte-array>
:>
buffer capacity
int
<ref>
:>
count
clear-errno
name gid buffer count
getgrouplist
:>
status
errno
:>
error count
int
deref
:>
required status 0
<
[
required capacity
>
[
required capacity!
t
]
[
error
EINTR
=
[
t
]
[
name error
group-list-error
]
if
]
if
]
[
buffer required
>groups
groups!
f
]
if
]
loop
groups
;