The main posixpp library and associated tests.
|9eb80934ba7d||2021-05-11 01:07:00||Eric Hopper||tip Fix 'move to self' bug.|
|b1efa70ccb74||2021-05-11 01:02:35||Eric Hopper||Move close to near top of member functions because it's i...|
|2c7097052749||2021-05-11 00:59:13||Eric Hopper||More dup documentation, add some TODOs.|
|845b89885277||2021-05-03 15:30:36||Eric Hopper||Make read, write, and open be 'free' functions. Justific...|
|21ff2fa93f67||2021-05-03 02:03:13||Eric Hopper||Use library to create tiny, no-runtime support program.|
|8e9f35b58b20||2021-05-02 23:48:07||Eric Hopper||Fix exit.|
|1f9d5bc4023b||2021-05-01 01:32:37||Eric Hopper||Add exit system calls, also hard to test for.|
|d30c74a036b5||2021-04-30 01:31:19||Eric Hopper||Implement dup3 as well, and add TODO for test case.|
|2737e2304026||2021-04-30 01:31:13||Eric Hopper||Tests for dup and dup2.|
|61484b250fd1||2021-04-28 21:51:39||Eric Hopper||Fix to use .native() instead of .string() to get filenames.|
|tip||9eb80934ba7d||2021-05-11 01:07:00||Eric Hopper|
|default||9eb80934ba7d||2021-05-11 01:07:00||Eric Hopper||Fix 'move to self' bug.|
With this project, I intend to implement many parts of Posix in pure C++ without any reliance on libc. There are several motivations for this:
errnois a horrible hack that is a throwback to a single threaded era and a language that could not sensibly return both error conditions and proper return values from the same function.
errnois the bane of clean error handling, and it requires expensive to access thread local storage to implement. Error returns should not be global variables.
For motivation 2 I intend to implement the system call interface for many architectures (and potentially many operating systems) as inline assembly inside of inline functions.
For motivation 3, a simple
expected type is used for error handling at
every level of the interface. This also causes default error handling
(if you just assume the
expected object always contains the expected
value) to throw an exception whenever errors are ignored. And if you
purposely check for errors, all code relating to exceptions will be
optimized out of existence.
Ideally, parts of the C++ standard library that rely on operating system facilities would also be implemented in this library.
For example, pthreads is a terrible interface, designed when threading was mysterious, strange, complex, and rare. And it was designed for old ideas about how threads should synchronize. It's far more expensive to use than it should be for simple mutexes and condition variables.
IOstreams isn't the best part of C++. But, being able to implement it while ignoring C's stdio might make things easier.
Lastly, it would be really nice to have a preprocessor namespace that isn't chock full macro definitions (most of which are just using the preprocessor to implement constants in a throwback to the days before C90). And it would be nice to have names and types for various flags passed to various system calls that made it easier to write correct programs.
As a side note, I really like Mercurial, and so the canonical repo is at OSDN: https://osdn.net/projects/posixpp/scm/hg/posixpp