Changes between Initial Version and Version 1 of POSIX_Definitions


Ignore:
Timestamp:
Feb 23, 2008, 4:18:58 AM (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • POSIX_Definitions

    v1 v1  
     1KEEP IN SYNC WITH lib/posix.h
     2
     3this header makes available commonly used POSIX (Portable Operating System
     4Interface) definitions, e.g. thread, file I/O and socket APIs.
     5on Linux and OS X we just include the requisite headers; Win32 doesn't really
     6support POSIX (+), so we have to implement everything ourselves.
     7
     8
     9rationale: this is preferable to a wrapper for several reasons:
     10 * less code (implementation is only needed on Win32)
     11 * no lock-in (the abstraction may prevent not-designed-for operations that the POSIX interface would have allowed)
     12 * familiarity (many coders already know POSIX)
     13
     14
     15if a useful definition is missing, feel free to add it!
     16
     17
     18implementation reference is the [http://www.unix.org/online.html "Single Unix Specification v3"] - it's similar to the POSIX standard (superset?) and freely available.
     19
     20
     21
     22+ Win32 does have a POSIX subsystem (mandated by a government contract),
     23but it is crippled. only apps with the PE header 'subsystem' field set to
     24"POSIX" can use the appendant DLL, and then they can't call the regular
     25Windows APIs. this is obviously unacceptable - GDI is needed to set up OpenGL.
     26
     27we therefore need to emulate POSIX functions using the Win32 API.
     28fortunately, many POSIX functions are already implemented in the VC CRT and
     29need only be renamed (e.g. _open, _stat).