|
From: Jim K. <jrk...@at...> - 1999-12-09 15:29:54
|
On Thu, 9 Dec 1999, Frank V. Castellucci wrote: > > Is endian-ness an issue in Linux? If a data file is created by a > > Linux/Intel application, can it be read by the Linux/PowerPC version of > > that application? > > > > Should CoreLinux provide some facility for conversion of endian-ness in > > cross-platform data? > > > > Jim Koontz > > jrk...@us... > > Data Files > -------------- > There is an issue that has to be addressed by the applications persistence > implementation or any persistence that the library provides. From a numeric > stand point using network byte order consistently should avoid that, or of > course characters. > > Source Files > ------------------ > There is an issue, I know bitfields and unions may be targets for analysis, > there may be more (I have been corrupted for too long by little-endianess) > but avoiding bit manipulation and unions is part of the CoreLinux standards. > > Binary Libraries and Apps > ------------------------------------ > Big issue, I don't know of solutions. > > > I'm hoping there are some who are running on both type of Linux > implementations (big and little) that we can test/verify against early on in > the development stages. > As far as the binary libraries and apps go, I think the only solution is to build them on each platform. The way that I have seen endian-ness resolved in other operating systems is to either save in one format, and provide code that does bit flipping if the platform reading is opposite-endian, or to save in a canonical format, that contains a flag field indicating the source platform. If the platform reading is opposite-endian from the platform that saved the data, the bit flipping takes place. In either case, macros that test for endian-ness and perform the bit-flipping are provided as part of the API. Jim Koontz jrk...@so... |