Date: Thu, 1 Oct 1998 20:52:36 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Nate Eldredge cc: djgpp-workers AT delorie DOT com Subject: Re: The long-awaited portability docs In-Reply-To: <3602DA41.2F5F96E6@cartsys.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 18 Sep 1998, Nate Eldredge wrote: > fter a bit of fussing, here is my first shot at the portability docs. Here are my comments to Nate's portability-related diffs. I don't send them as diffs since I hope somebody else will have time to convert what's below to Texinfo before I find enough free time for it (which might not happen for quite a while ;-). - Didn't we agree that ANSI implies POSIX, and therefore there's no need to mention both in ANSI functions? - isascii and toascii are supported by DOS compilers (at least Borland has them). They ae BSD functions, so many Unix systems also support them. - acosh, asinh, atanh, hypot, and other non-ANSI math functions are probably supported by every Unix box out there. Borland has hypot and pow10. - Most Unix systems have _doprnt (it is a widely-used alternative for the lack of vfprintf in many GNU packages). I believe the same is true for _doscan. - fopen: I think it should be mentioned that some old non-ANSI compilers won't accept "b". - fseek and ftell should warn about problems wrt DOS text files which haunt many DOS compilers other than DJGPP. - getw and putw are from SysV; they are supported by DOS compilers and by many Unix systems. - I think printf should mention non-portable format specifiers. - remove should mention that other DOS/Windows compilers won't delete directories and read-only files while DJGPP (and Posix systems) will. - rename should mention that renaming directories and automatic removal of the target if it exists are not supported by other DOS compilers. - _rename should say that it works like rename in other DOS compilers. - setbuffer and setlinebuf are available on BSD Unix systems. - sprintf: add a comment that old non-ANSI libraries (SunOS) have sprintf that returns a char * pointer to its first argument, not an int. - abort should mention that it usually causes a core dump on Unix systems. - system should mention that other DOS compilers generally pass the argument to %COMSPEC%, and don't support all the extended functionality and __system_* flags. - sys_errlist[] and sys_nerr are supported by many Unix systems. MSC, TC and BC also have it. - tzset is available on BSD. - _bios_* functions are available in MSC and BC, and bios* varieties are available in BC and TC. - bcmp, bcopy, bzer, index, rindex -- these are BSD functions. - log2 is available on many Unix systems. - mprotect and *mntent are available on many Unix systems. - insque and remque are available on both BSD and SysV Unix. - sys_siglist[] is available on many Unix systems. - mktemp and mkstemp are BSD. - tempnam is supported on many Unix systems. - alloca is available on almost every Unix system, and on some non-Unix ones. MSC and Borland C support it as well. - getpass is BSD. Borland (and MSC, I think) support it also, but Turbo C declares its prototype in (!). - itoa, ecvt, fcvt, and gcvt are almost universally supported, both on Unix and DOS/Windows. BSD has econvert and fconvert which work like ecvtbuf and fcvtbuf, respectively. - putenv is supported by TC and BC, and also by many Unix systems. - random, srandom, and {init,set}state are BSD; a warning should be included about an incompatible Borland macro called `random'. - swab is supported on almost any system, including Unix and DOS. - ffs is BSD. - memccpy is supported on BSD Unix and on DOS (Borland, at least). - memicmp is supported by other DOS compilers. - stpcpy is supported by DOS compilers and by some Unix systems like Linux. - strcasecmp and strncasecmp are supported by many Unix systems. - strdup is supported by DOS compilers and many Unix systems. - stricmp, strnicmp, strupr and strlwr are supported on DOS. - getrlimit, setrlimit, and getrusage are supported by many Unix systems; I think we should mention that other than sack length and max file name length, the info returned by DJGGP is meaningless. - mknod is supported by both BSD and SysV families of Unix. - statfs is suppored on many Unix systems, alhough some of them have different argument lists. BSD systems support the exact variety that DJGPP offers. - select is supported by most Unix systems. - settimeofday is supported by some Unix systems. - utimes is supported on BSD Unix systems. - basename and dirname are supported on Linux. - fsync and sync are suported on almost every Unix system. - ftruncate seems to be BSD. - gethostname is BSD. - getdtablesize and getpagesize are BSD, but are also supported on most Unix systems. - getwd is BSD. - nice is supported on most Unix systems. - truncate is suppored on Unix. - vfork is BSD and is supported on many Unix systems. - brk and sbrk are supported on almost any platform, including most Unix systems and many DOS compilers. - _stklen is supported by Borland. - _exit is available on most platforms, including Unix and DOS. - _dos_* functions are supported by many DOS compilers, including MSC and BC. - findfirst, findnext, fnsplit and fnmerge are supported by Borland. Mention LFN support that is unique to DJGPP. - ftw is from SysV, and is supported by many Unix systems (not only those of the SysV family). - getdisk and setdisk are supported by Borland. - searchpath is supported by Borland. - bdos and bdosptr are supported by many DOS compilers. - int86, int86x, intdos and intdosx are supported by all DOS compilers. - delay is supported by DOS compilers. - getcbrk and setcbrk are available in Borland. - getdate and setdate are available in Borland. - getdfree, getftime and setftime are supported by Borland. - gettime and settime are available in Borland. - gettimeofday is BSD and is supported on many Unix systems. - _doserrno is supported by DOS compilers. - _chmod, _close, _creat, _open, _read and _write are supported by Borland (and maybe by other DOS compilers). - _dos_lock and _dos_unlock are supported by MSC and BC. - _fmode is supported by Borland. - setmode is available in Borland; MSC has _setmode. - tell is available on many platforms, including Unix and DOS. - ftime is supported by many Unix systems and DOS compilers. - _8087 is supported by Borland. - all conio functions except _set_screen_lines, _setcursortype, blinkvideo and intensevideo are supported by Borland. - htonl, htons, ntohl, and ntohs are non-ANSI and non-Posix. Unix systems support them. - _clear87, _fpreset, _control87 and _status87 are supported by Borland. - matherr is supported by almost every platform, including Unix and many DOS compilers (MSC, TC, BC). - enable and disable are supported by Borland; MSC has _enable and _disable. - inp* and outp* functions which read/write a single byte/word/dword are supported by DOS compilers. - kbhit is supported by Borland. - movedata is available in Borland, but we should warn that it works with segments, not selectors! - sound and nosound are portable to Borland. - opendir, readdir, closedir are available on some DOS compilers (MSC and BC) but not on others (TC, VC++). - seekdir and telldir are suported on many Unix systems. - creat, open, close, dup, dup2, read, write are supported by all DOS compilers. Note that other DOS compilers won't automatically expand the file handle table once the first 20 handles fill up. - *grent and *pwent functions are supported on many Unix systems. - setitimer and getitimer are BSD and are supported by many Unix systems. - fdopen and fileno are supported by DOS compilers. - chmod is supported by Borland. - filelength is supported by Borland. - stat and fstat are supported by all DOS/Windows compilers, but many of the struct stat members are either not set (left at zero) or not reported correctly in some cases. - umask is supported by DOS compilers. - termios functions: I wonder whether we should say that this is implemented wih BIOS calls (because this has some important portability-related implications)? - access is supported by DOS compilers, but will fail there for some special files, like root directories. - chdir is supported by DOS compilers, but doesn't change drive. - exec* and spawn* functions are supported by all DOS compilers, but cannot support long command lines. - getcwd is supported by other DOS compilers. - getopt is supported by almost all DOS compilers. - isatty and lseek are supported by all DOS compilers. - rmdir and sleep are supported on DOS. - unlink is supported by other DOS compilers, but it won't delete read-only files and it won't delete directories.