Date: Sun, 30 Jan 2005 00:04:18 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 517 ************************************************** Saturday 29 January 2005 Number 517 ************************************************** Subjects for today 1 Re: SC_PAGESIZE and Innotek_libc : Knut St. Osmundsen" 2 Re: DosDevIOCtl and innotek_libc : Knut St. Osmundsen" 3 Re: zlib : Knut St. Osmundsen" **= Email 1 ==========================** Date: Fri, 28 Jan 2005 18:54:34 +0100 From: "Knut St. Osmundsen" Subject: Re: SC_PAGESIZE and Innotek_libc Dave Yeo wrote: > I see that SC_PAGESIZE is defined in unistd.h but doesn't exist in lib. You also see that it's only defined #if __POSIX_VISIBLE >= 199309. It looks like either unistd.h isn't included or __POSIX_VISIBLE isn't set as exected. Someone reported another problem related to __POSIX_VISIBLE being 0, so someone have to figure out why it's not set as expected - it's probably a bug somewhere in the headers. I will not have time to look at it for some time still, so if you wanna help start by inserting the following statements between includes. #if !__POSIX_VISIBLE # error "POSIX_VISIBLE=0" #endif You might have to change the test, and perhaps add #include at the top to see if it's correctly defined from the start of. > libcwrapper.c: In function `xf86getpagesize': > libcwrapper.c:1844: error: `_SC_PAGESIZE' undeclared (first use in this function) > > should I plan on this working later or just define that we don't have it? here is where it is defined > /* For xf86getpagesize() */ > #if defined(linux) > #define HAS_SC_PAGESIZE > #define HAS_GETPAGESIZE > #elif defined(CSRG_BASED) > #define HAS_GETPAGESIZE > #elif defined(DGUX) > #define HAS_GETPAGESIZE > #elif defined(sun) && !defined(SVR4) > #define HAS_GETPAGESIZE > #endif > #ifdef XNO_SYSCONF > #undef _SC_PAGESIZE > #endif > #ifdef HAVE_SYSV_IPC > #include > #include > #endif > #include > > Strangely this didn't seem to be a problem with EMX and gcc 3.0.3 That's because it's not the same headers. unistd.h based on the FreeBSD header. Kind Regards, knut **= Email 2 ==========================** Date: Fri, 28 Jan 2005 18:57:56 +0100 From: "Knut St. Osmundsen" Subject: Re: DosDevIOCtl and innotek_libc Dave Yeo wrote: > Hi I'm getting undefined symbol _DosDevIOCtl in os2main.o from xterm. This didn't > happen under EMX.. Adding #define INCL_DOSDEVICES seems to of fixed this. That's because you need a prototype of DosDevIOCtl to get the calling convention (and so the mangling) right. INCL_DOSDEVICE causes os2emx.h to include this. Kind Regards, knut **= Email 3 ==========================** Date: Fri, 28 Jan 2005 19:11:00 +0100 From: "Knut St. Osmundsen" Subject: Re: zlib Roman Trunov wrote: > Hello Dave, > > DY> I'm still in conflict about whether to use Z.DLL (with ords, > DY> backward compatible with lots of apps, especially in X) or > DY> ZLIB1.DLL (without ords, recommended by the Z developers). > > I always thought that export by name will create an ordinal number in > executable anyway. Yes, but if you don't specify ordinal numbers you they will be assigned by the linker, and in an order you don't expect (because of the internal symbol hashing in the linker I believe). The import librarian will use the names and not the ordinals in this case. > Just write correct .def file to make ordinals of > your exported names match ordinal numbers of old Z.DLL - and your DLL > can be linked with both types of programs. Be aware that when specifying both name and ordinal the name will be non-resident, i.e. the loader will have to read the name table from the disk every now and again. Use the RESIDENTNAME (IIRC) to flag that you want both ordinal and resident name for best performance. Also when you specify ordinals, the import librarian will use the ordinals (at least when subjected to the .def file). Generally speaking, name based exports aren't fast in OS/2 and should be avoided if the DLL have more than a few exports. On the other hand, name based exports are more convenient if you don't handcraft the .def file. Kind Regards, knut