<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.3.2">
</HEAD>
<BODY>
Markus,<BR>
<BR>
This patch can't be applied. Not all platforms have getgid() and getuid() functions. Placing non-portable code outside of lib/System is deprecated. We set the values to 1000 by default because in general the uid/gid doesn't matter in an archive and the 1000 value gets you to a safe (non-root, non-system) value. If a specific value for these is needed on a given platform, then we need to implement something like "getDefaultUserId" and "getDefaultGroupId"  functions in lib/System and use those in lib/Bytecode/Archive. <BR>
<BR>
Is there a specific problem that is driving these changes?<BR>
<BR>
Reid.<BR>
<BR>
On Thu, 2005-04-21 at 17:17 +0200, Markus F.X.J. Oberhumer wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Jeff Cohen wrote:</FONT>
<FONT COLOR="#000000">> Misha Brukman wrote:</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">>>> I didn't use get{u,g}id() because that's not portable - I think we</FONT>
<FONT COLOR="#000000">>>> need another abstraction in the System library for these.</FONT>
<FONT COLOR="#000000">>>>   </FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">>> Hmm, seems like it's available on the Unices that we support: Linux, OS</FONT>
<FONT COLOR="#000000">>> X, and SunOS.  Man page lists getgid() as conforming to POSIX and BSD</FONT>
<FONT COLOR="#000000">>> 4.3, so I'm assuming *BSD has them too (can't confirm for lack of a *BSD</FONT>
<FONT COLOR="#000000">>> system).  As soon as we run into a Unix system that we want to support,</FONT>
<FONT COLOR="#000000">>> we might have to go the abstraction route, but it seems to work for our</FONT>
<FONT COLOR="#000000">>> currently-supported platforms.</FONT>
<FONT COLOR="#000000">>>  </FONT>
<FONT COLOR="#000000">>></FONT>
<FONT COLOR="#000000">> FreeBSD has them.  According to its man pages, getuid was introduced in </FONT>
<FONT COLOR="#000000">> Version 7 AT&T Unix.  Ancient history.  It doesn't say when getgid was </FONT>
<FONT COLOR="#000000">> introduced, but it's just as old as it's documented in my 1980 edition </FONT>
<FONT COLOR="#000000">> Berkeley VAX UNIX manual, and in any case both are in POSIX.1 and </FONT>
<FONT COLOR="#000000">> therefore ought to be portable by definition.</FONT>

<FONT COLOR="#000000">Does windows have these ?</FONT>

<FONT COLOR="#000000">In any case, below is another small patch for lib/Bytecode/Archive.</FONT>

<FONT COLOR="#000000">~Markus</FONT>

<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">LLVM Developers mailing list</FONT>
<FONT COLOR="#000000"><A HREF="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</A>         <A HREF="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</A></FONT>
<FONT COLOR="#000000"><A HREF="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev</A></FONT>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
<BR>
<ADDRESS>
<I><FONT SIZE="4">_______________________</FONT></I><BR>
<I><FONT SIZE="4">Reid Spencer</FONT></I><BR>
<I><FONT SIZE="4">President & CTO</FONT></I><BR>
<I><FONT SIZE="4">eXtensible Systems, Inc.</FONT></I><BR>
<I><FONT SIZE="4">rspencer@x10sys.com</FONT></I>
</ADDRESS>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>