unix.groups: 64 ought to be enough, right?

db4
John Benediktsson 2012-02-02 19:41:39 -08:00
parent 0ddb6fa96e
commit c730bf62bd
2 changed files with 2 additions and 4 deletions

View File

@ -18,7 +18,7 @@ CONSTANT: PROT_NONE 0
CONSTANT: PROT_READ 1
CONSTANT: PROT_WRITE 2
CONSTANT: PROT_EXEC 4
CONSTANT: MAP_FILE 0
CONSTANT: MAP_SHARED 1
CONSTANT: MAP_PRIVATE 2
@ -29,8 +29,6 @@ CONSTANT: SEEK_END 2
: MAP_FAILED ( -- alien ) -1 <alien> ; inline
CONSTANT: NGROUPS_MAX 16
CONSTANT: DT_UNKNOWN 0
CONSTANT: DT_FIFO 1
CONSTANT: DT_CHR 2

View File

@ -71,7 +71,7 @@ ERROR: no-group string ;
: (user-groups) ( string -- seq )
#! first group is -1337, legacy unix code
-1337 unix.ffi:NGROUPS_MAX [ 4 * <byte-array> ] keep
-1337 64 [ 4 * <byte-array> ] keep
int <ref> [ [ unix.ffi:getgrouplist ] unix-system-call drop ] 2keep
[ 4 tail-slice ] [ int deref 1 - ] bi* >groups ;