2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

C++ Wrapper for Standard UNIX Functions


Detailed Description

Goals
  1. 100% uniform error handling for all functions.
  2. 100% functionality for included functions.
  3. Organization into UNIX objects.
  4. Elimination of redundant, obsolete, or defective functions (readdir, signal, mktemp) where there is an alternative.
  5. As close to native-C-interface speed as possible.
Design Rules
  1. At the level of Standard UNIX Specification v3 -- no higher, and with identical semantics (other than error handling). That is, not like iostream or Boost threads. However, additional functions (e.g., setblock, find_and_open_master) not in the standard can be included.
  2. 100% implementation of 290 or so interfaces out of the 1108 that are in the SUS. The 290 were selected for a book I'm working on. (Excluded are Standard C functions, pthreads, user-level functions such as bsearch and accounting, spawn stuff, trace stuff, obsolete functions, and a few others. (Details available.)
  3. All errors are thrown, never returned. Thrown object is a type that includes errno and other error codes (e.g., from getaddrinfo) that are not errno-type errors.
  4. No memory is dynamically allocated unless the word "alloc" appears in the member-function name, and there are very few instances of that.
  5. Space and time efficiency should be very close to native C SUS, except for the member-function-call overhead.
  6. Objects reflect organization of UNIX and SUS objects (e.g., File, Dir, DirStream, Process).
  7. Where a reentrant and non-reentrant functions are defined (e.g., readdir and readdir_r), usually the re-entrant version is used and the buffer is in the object. If necessary, an "alloc" member function is provided to allocate storage for it (see #4, above).
  8. No additional error checking over what the SUS function provides. For example, if a NULL pointer is passed to File::open, it is passed directly to the underlying open. This is because of #5, above.
  9. Automatically chooses, for example, fchown over chown if object is open. Single member function File::chown for both.
  10. Automatically detects whether an error occurred in some cases. For example, for pathconf, a -1 return is an error only if errno changed.
  11. Some functions coalesced with use of optional arguments. For example, read/pread, write/pwrite, fsync/fdatasync.
  12. No copy constructors or assignment operators other than default. Follows from #4, in part.


Namespaces

namespace  Ux

Compounds

class  Aio
class  Base
class  Clock
class  Dir
class  DirStream
class  Error
class  ExitStatus
class  File
class  IntervalTimer
class  Netdb
class  PosixMsg
class  PosixSem
class  PosixShm
class  Process
class  Pty
class  RealtimeTimer
union  semun
class  Sigset
class  SockAddr
class  SockAddrIn
class  SockAddrUn
class  Socket
class  SockIPv4
class  SockIPv6
class  System
class  SysVIPC
class  SysVMsg
class  SysVSem
class  SysVShm
class  Terminal
class  Termios
class  TimeMsec
class  TimeNsec
class  TimeParts
class  Timer
class  TimeSec
class  Timestr
class  TimeString
class  Timet
class  Timetm
class  Timeval


Generated on Fri Apr 23 10:57:16 2004 for AUP2 Example Source by doxygen 1.3.1