[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Fri Apr 10 12:32:52 CEST 2009


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	09/04/10 12:32:52

Modified files:
	cm3/m3-libs/m3core/src/unix/Common/: Uconstants.c UdirC.c 
	                                     Uexec.c Ugrp.i3 Umman.i3 
	                                     Unetdb.c Unix.i3 UnixC.c 
	                                     Upthread.i3 Usocket.c 
	                                     Ustat.i3 UstatC.c UtimeC.c 
	                                     Utypes.i3 Uucontext.c 
	                                     m3makefile m3unix.h 
	cm3/m3-libs/m3core/src/unix/cygwin/: Usysdep.i3 
	cm3/m3-libs/m3core/src/unix/darwin-common/: Usysdep.i3 
	cm3/m3-libs/m3core/src/unix/freebsd-common/: Usysdep.i3 
	cm3/m3-libs/m3core/src/unix/hpux-common/: Usysdep.i3 
	cm3/m3-libs/m3core/src/unix/linux-common/: Usysdep.i3 
	cm3/m3-libs/m3core/src/unix/netbsd-common/: Usysdep.i3 
	cm3/m3-libs/m3core/src/unix/openbsd-common/: Usysdep.i3 
	cm3/m3-libs/m3core/src/unix/solaris-common/: Usysdep.i3 
Added files:
	cm3/m3-libs/m3core/src/unix/Common/: Ugrp.c Umman.c 

Log message:
	a bunch of churn here:
	
	- provide Ugrp.i3, Ugrp.c for cvsup
	Make it copying for safety.
	Though every system I checked defines the struct with the exact same
	members and order, though we no longer make gid_t match (below) so copying
	becomes possibly needed. Don't bother with passwd.
	
	- add mknod, mmap, munmap, umask for cvsup
	
	- add some mmap flags for cvsup, go ahead and add some it doesn't use either
	the additions to Uconstants are under #ifdef
	previously I had trimmed Umman to just mprotect
	
	- continue experiment where we "wrap everything" (e.g. mknod, umask, mmap, munmap, Ugrp.i3)
	instead of only functions with a clear need (the need hasn't always been clear!)
	
	- push more stuff into m3unix.h due to a sort of intellectual laziness
	unclear benefit includes now everything is prototyped, not just implemented and not used,
	not clear if that is any progress
	
	- widen mode_t from int to INTEGER
	
	- change gid_t, pid_t, uid_t from system dependent to not
	pid_t is always 32 bit signed integer
	gid_t and uid_t is always 32 bit integer, of varying signedness
	change them all to INTEGER
	INTEGER is more predictably laid out and aligned the same on
	64bit platforms -- that is, we need to be able to duplicate
	structs in Modula-3 and C and have a /very/ high confidence
	that they match up (we should probably pass in sizes from Modula-3,
	and maybe even field offset?)
	
	- change pthread_t from system dependent to not
	on the vast majority of systems, sizeof(pthread_t) == sizeof(integer,size_t,void*)
	Known exceptions are 64bit Solaris and I think 64 bit HP-UX; on those
	pthread_t is just a 32bit integer and this change might waste a little space
	
	- assert correctness or enough correctness of various types -- that the
	Modula-3 types are at least as large as the C types
	that pid_t is signed (presumably so you can check for <0 or == -1 or something)
	that short/int/long/CHAR_BIT are what we expect
	(punt on portability to CHAR_BIT != 8 -- i.e. a conforming C implementation
	can have CHAR_BIT=32 and then sizeof(char)==sizeof(short)==sizeof(int)==sizeof(long)==4)
	
	- #ifdef guard on m3unix.h; extern "C" in more places
	
	- remove presumably unused passwd from Ugrp.i3
	
	- reorder Ugrp.i3 -- size then name; this is arbitrary and unnecessary though
	
	- rename SOCKLEN_T to m3_socklen_t (tempting to just use one set of wrappers here instead of two..)
	
	- remove FreeBSD-common clock_t, appears dead (only currently affects AMD64_FREEBSD)
	
	- a lot of this is still tedious and error-prone, but at least very portable




More information about the M3commit mailing list