In article <200606161327.35948.jfh / cise.ufl.edu>,
  "James F. Hranicky" <jfh / cise.ufl.edu> writes:

> Ok -- I think I'm going to take Sam's advice and turn it into one
> method that returns [uid, gid] .

I like a hash: {:euid => euid, :egid => egid }

> It depends on the platform -- on FreeBSD it's euid, on Linux (I think) it's
> ruid and on Solaris it can be anything, though I stuck with ruid. 

It seems euid/egid on Linux.

% sudo ./ruby -rsocket -ve '
File.unlink("/tmp/s") rescue nil
Process.egid = 1
Process.euid = 2
p [[Process.uid, Process.euid], [Process.gid, Process.egid]]
serv = UNIXServer.open("/tmp/s")
File.chmod(0777, "/tmp/s")
Process.euid = 0
Process.egid = 3
Process.euid = 4
p [[Process.uid, Process.euid], [Process.gid, Process.egid]]
c = UNIXSocket.open("/tmp/s")
Process.euid = 0
Process.egid = 5
Process.euid = 6
p [[Process.uid, Process.euid], [Process.gid, Process.egid]]
s = serv.accept
p [s.peer_uid, s.peer_gid]
p [c.peer_uid, c.peer_gid]
'
ruby 1.8.4 (2006-06-17) [i686-linux]
[[0, 2], [0, 1]]
[[0, 4], [0, 3]]
[[0, 6], [0, 5]]
[4, 3]
[2, 1]
% uname -a
Linux nute 2.6.15-1-686 #2 Mon Mar 6 15:27:08 UTC 2006 i686 GNU/Linux
-- 
Tanaka Akira